how to read a file in other directory in python
- by mazen.r.f
i have a file its name is 5_1.txt in a directory i named it direct ,
how can i read that file using the instruction read.
i verified the path using :
os.getcwd()
os.path.exists(direct)
the result was
True
x_file=open(direct,'r')
and i got this error :
Traceback (most recent call last):
File "<pyshell#17>", line 1, in <module>
x_file=open(direct,'r')
IOError: [Errno 13] Permission denied
i don't know why i can't read the file ? any suggestion ?
thanks .