Learn To Program
Increase Your Knowlegde and Build Your Skill!
Pages
(Move to ...)
Home
Me
▼
Friday, December 31, 2010
Reading File In Python
To read a text file, use:
fp = open("file.txt","r");
print fp.read()
For writing to a file, use:
fp = open("data.txt","w");
write("Hello World");
fp.close();
No comments:
Post a Comment
‹
›
Home
View web version
No comments:
Post a Comment