0
区切り文字付きのテキストファイルを区切って書き出すには、this tutorial hereに従うが、出力時には1つのファイルしか取得しない。これはpython2 - > 3の問題ですか?助けてください。区切り文字で区切って一意のファイルを書き込む
filename = ('file path')
with open(filename) as Input:
op = ''
start = 0
count = 1
for x in Input.read().split("\n"):
if (x == 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'):
if (start == 1):
with open(str(count) + '.txt', 'w') as Output:
Output.write(op)
Output.close()
op = ''
count = + 1
else:
start = 1
Input.close()