首先通过终端进入jupyter notebook(命令为jupyter notebook)
import os
filename = ‘input2.txt’
with open(filename, ‘r’) as file_to_read:
with open(“valtrain.txt”, “w+”) as file_to_write:
for i,line in enumerate (file_to_read.readlines()):
line = line[0:11] + "\n"
file_to_write.writelines(line)