Mega Code Archive
Categories
/
Python
/
File
Write string to a file
f = open('somefile.txt', 'w') f.write('Hello, ') f.write('World!') f.close()