當前位置:成語大全網 - 書法字典 - Python字典多行文本

Python字典多行文本

#?-*-?編碼:utf-8?-*-

#原始文件

f?=?打開(‘d:\ \ 000001 . CSV‘,?r+‘)

#新文件

t?=?打開(‘d:\ \ 000002 . txt‘,?w+‘)

n?=?1

x?=?100

#讀取100行並插入壹條數據。

為了什麽?我?在?f.readlines():

t.write(壹)

如果?n%100?==?0:

t . write(-% s-\ n?%x)

n?=?n?+?1

關閉()

關閉()