Working a lot with SHP/TXT/KML files in Python on Windows, I have found it helpful to refresh my how-to memory :
To find out where you are:
WorkingDirectory = os.getcwd()
To change directories:
Really useful is the glob module.
for file in glob.glob(“*.*”):
print file # print all file names in dir
for shp in glob.glob(“*.shp”):
print shp # print names of all shapefiles in dir
Obviously, there is much more, e.g. os.path. See here (http://effbot.org/librarybook/os.htm) and here (http://docs.python.org/library/os.path.html).