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()
1. | Writing to Files | ||
2. | File writelines(list) | ||
3. | File write(string) | ||
4. | Looping Over Characters with read Writing the Loop Differently | ||
5. | File Output |