Che M wrote:
I have been using absolute paths in my programs, but
want to get out of the habit as I try to run them on
other computers.  I was surprised to find that this
type of reference didn't work:

path = '/subfolder/myfile.py'

Pathnames are relative by default.  So:
   'myfile.py'
would be the file myfile.py in the current directory.
   'subfolder/myfile.py'
would be myfile.py inside subfolder, which is below the current directory.

It's the initial / character which makes it absolute, and start from the root directory.

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to