这是附加到文本文件的代码,在我运行程序之后,我检查了记事本文件以查看结果。我发现我输入的每个名字都是合二为一的。如何通过Python将记事本文件中的名称拆分?你知道吗
import time
print("Please contact a technician - what is your name?")
name = input(">")
print("I will allocate your name as a case number for a"\
" future technician, so that they can assist you.")
fi = open("casenumbers.txt", "a")
fi.write(str(name))
fi.close()
print("The name you should contact us with is",name,"")
time.sleep(20)
使用
fi.write(str(name)+" \t")
拆分名称。你知道吗相关问题 更多 >
编程相关推荐