Python 2.7 file read error -
i struggling file access - have python 2.7 here: c:\python27
i created txt file data.txt
and trying shell read , print values it. location of data.txt in same folder (c:\python27\data.txt)
every time got same error msg:
traceback (most recent call last): file "c:/python27/filereader.py", line 1, in <module> infile = open('data.txt', 'r') # open file reading. ioerror: [errno 2] no such file or directory: 'data'
you need enter full filename data.txt instead of data only:
infile = open('data.txt', 'r')
Comments
Post a Comment