我需要这些线进入“for”循环以缩短整个模块。你知道吗
peanut = codecs.open("butter.txt", mode="w")
duck = codecs.open("tape.txt", mode="w")
hair = codecs.open("style.txt", mode="w")
italy = codecs.open("spaghetti.txt", mode="w")
smile = codecs.open("cheese.txt", mode="w")
比如:
for five_txt in peanut, duck, hair, italy, smile:
codecs.open()
现在还可以从字典中访问实例,如:
将文件名放入一个列表中并遍历它。你知道吗
相关问题 更多 >
编程相关推荐