02 2022 档案
摘要:#利用sys.argv(实现从程序外部向程序传递参数。)写一个脚本。#全局替换(old_str to new_str,filename)import sys #导入sys模块print(sys.argv)old_str = sys.argv[1] #因为索引0是sys的本身路径,所以开始索引为1ne
阅读全文
摘要:import random #导入模块import stringcount = 1 #计数器while count < 4: #循环(while : 当) for i in range(1): #for循环(迭代器range) input(f"现在我们进行第{count}次抽奖,为{4-count}
阅读全文