1、文件读写
import codecs
fw = codecs.open(‘test.txt’, ‘w’, ‘utf-8’)
fr =codecs.open(‘test.txt’)
n = 10
count = 1
while(n):
fw.write(str(count))
fw.seek(0,0)
count = int(fr.read())
count +=1
fr.seek(0,0)
n -= 1
python-
最新推荐文章于 2022-01-06 21:45:21 发布