Wednesday, July 8, 2015

File handlign in python



Reading ,Writing to a file in Python

fo = open("test.txt","w")
str1="This is a Test file written from Python Program"
fo.write(str1)
fo.close()
fo = open("test.txt","r")
str=fo.read(100)
print str
fo.close

No comments:

Post a Comment