02 2022 档案

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

点击右上角即可分享
微信分享提示