Reading a file in Python
Source code for reading a file in Python:
file=open(’2.txt’,'r’)
file1=file.read()
file.close
to see the contents of the read file simply use
print file1
July 28th, 2008 in
Python
Source code for reading a file in Python:
file=open(’2.txt’,'r’)
file1=file.read()
file.close
to see the contents of the read file simply use
print file1