Saturday, August 1, 2009

Python: get current working directory

Share at Facebook

The os library of Python is simply awesome. If you need to get the current working directory of your script. Just used the getcwd() function from os package. Its like below.

print os.getcwd()

It will output your path something like below
E:\Documents and Settings\alesandro\Desktop\Work\temp

No comments: