file open "no such file"

Gary Wessle phddas at yahoo.com
Sun Apr 30 20:10:08 EDT 2006


I am getting this error when I try to run the code below

****************
f = open("~/m", "r")
print f.read()
****************

****************
:~$ python python/my.py 
Traceback (most recent call last):
  File "python/my.py", line 1, in ?
    f = open("~/m", "r")
IOError: [Errno 2] No such file or directory: '~/m'
****************

but I have the "m" file in my home/username/


thank you



More information about the Python-list mailing list