[Tutor] Opening files?
alan.gauld@bt.com
alan.gauld@bt.com
Wed Mar 26 13:20:13 2003
> >>> myTest = open("C:test.txt", 'r')
You probably need to specify the directory as wekll as the drive:
myTest = open("C:\\test.txt") # read by default, \\ coz of escaped chars
OR
myTest = open("C:/test.txt") # read by default, / works in a path
> <open file 'C:test.txt', mode 'r' at 0x0090CE18>
> What is the last bit? An address of sorts?
Yes, its where the file object is living in memory....
Alan g.
Author of the Learn to Program website
http://www.freenetpages.co.uk/hp/alan.gauld/