Next Index Previous

Python Examples

11. Program to create a text file.

fh = open('hello.txt','w')
fh.write('Hello to all')
fh.close()