Open a text file and write a line of text : Text File Read Write : File PYTHON examples


PYTHON examples » File » Text File Read Write »

 

Open a text file and write a line of text




myfile = open('myfile', 'w')             # open for output (creates)

myfile.write('hello text filen')        # write a line of text

myfile.close()

           
       



Leave a Comment / Note


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


PYTHON examples

 Navioo File
» Text File Read Write