Open a file and save text to it : Text file : File PYTHON TUTORIALS


PYTHON TUTORIALS » File » Text file »

 

Open a file and save text to it


f = open('temp.txt', 'w')
for i in range(250):
    f.write('%03d)  this is a test.n' % i)
f.close()



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo File
» Text file