Forums

Can't Access Any Files or Directories

Hi, I'm running a python program where I need to read a file. The .txt file is in a folder and the folder is in the same directory as my .py file. The program worked on my computer but isn't on here. I get an IOError: [Errno 2] No such file or directory. I tried putting the .txt file in the same location as the .py file but no difference.

Any suggestions?

Hi, try using the absolute file path, so "/home/PavSidhu/xxx' as Python often gets confused with where files are located.

+1 to what rcs1000 says, that's normally the problem with this kind of error.

thanks rcs1000, it worked!