Writes the contents of string to the file : File Write « File « Python






Writes the contents of string to the file

 

f = open('/tmp/workfile', 'r+')
f.write('0123456789abcdef')
print f.read(1)        

print f.read(1)

f.close()

           
         
  








Related examples in the same category

1.Writing to FilesWriting to Files
2.File writelines(list)
3.File write(string)
4.Looping Over Characters with read Writing the Loop Differently
5.File Output