我是一名python初学者。 我写一个文件为:写入python3文件
with open("Init", mode='w') as out:
out.write(datName)
out.write("\n")
out.write("T\n")
out.write(datGroup)
out.write("\n")
out.write(datLatx)
out.write(" ")
,而这是工作,它正在寻找坏的(空间和换行符是分开写的语句)。
我看过这个page,但还是不知道。
有没有更好的方法来做到这一点out.write(datName"\n")
是无效的?