[EMAIL PROTECTED] wrote: > And, finally, the python docs all note that symbols like . and .. > don't work with these commands.
Where did you read that? The docs for os.listdir do say that '.' and '..' are (sensibly) not returned as *results*. AFAIK there is nothing to stop you using '.' or '..' as a path *argument* where appropriate/useful. > How can I grab the directory that my > script is residing in? C:\junk>type scriptdir.py import sys, os.path scriptpath = sys.argv[0] # read the docs for sys.argv print "script is", scriptpath scriptdir = os.path.split(scriptpath)[0] # read the docs for os.path.split print "script lives in", scriptdir C:\junk>scriptdir.py script is C:\junk\scriptdir.py script lives in C:\junk C:\junk>move scriptdir.py \bin C:\junk>scriptdir.py script is c:\bin\scriptdir.py script lives in c:\bin [Curiosity: drive letter is upper-case in first example, lower in second] HTH, John -- http://mail.python.org/mailman/listinfo/python-list