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' But instead I did it this way and it works: import os.path self.currentdir = os.curdir self.mysubfolder = os.path.join(self.currentdir, "subfolder") path = self.mysubfolder + '/myfile.py' Is this really the only way to do it,and so I have to import os.path each time I have a case where I refer to a subdirectory? It seems like something quick/built-in like the first way should work, or maybe I am misunderstanding something? Thanks. _________________________________________________________________ Windows Liveā¢: Keep your life in sync. http://windowslive.com/explore?ocid=TXT_TAGLM_WL_t1_allup_explore_012009 _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor