Pragmatic Python
Pages
Home
Data Structures & Algos
Data Science & ML
Online Courses
Project Euler
Python Challenge
Tuesday, February 4, 2014
Write To A File Simple Way
#!/usr/bin/python
# Open a file
fo = open("foo.txt", "w")
fo.write( "Python is a great language.\nYeah its great!!\n");
# Close opend file
fo.close()
Source:
http://www.tutorialspoint.com/python/python_files_io.htm
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment