Writes a string to the file.
file. write(str)
- str
- A string you want to write to the file.
There is no return value. Due to buffering, the string may not actually show up in the file until the flush() or close() method is called.
None
#TODO
>>> f = open(r'C:\test.txt', 'w')
>>> f.write('foo')
>>> f.close()
>>> f = open(r'C:\test.txt')
>>> f.read()
'foo'#TODO