write in TXT file by python

Simple example to open a new TXT file and write down some helpful data.


import time

fin = open("data.txt", "w")
fin.write(str(1000 * round(time.time())))
fin.write("Hello Python World !")
fin.write("\n")
fin.close()

猜你喜欢

转载自blog.csdn.net/cutelily2014/article/details/80282365