Learn Python Easy Way
Wednesday, December 9, 2015
write lines to file: create file easy way
def create_file('file_name', 'text'):
with open(INDEX_HTML,"w") as fp:
fp.writelines(html_contents)
create_file('test.txt', 'hello world')
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment