* Laszlo Antal <[EMAIL PROTECTED]> [061212 18:12]: > Hi, > > I use this: > > # This is the file name this code is in > curfile = "findcurdir.py" > #__file__ gives everything so slice off the file name > curdir = __file__[:-len(curfile)] > print curdir > #will print the curdir the file is in > #even if this file(module) has been imported
What about using os.path.dirname and os.path.basename for this splitting? Andreas _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor