By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,941 Members | 1,753 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,941 IT Pros & Developers. It's quick & easy.

How to find the present working directory using python.

P: n/a
how to find out the present working directory using python.

os.system('pwd') works good. But i need some specific one in
python rather than embedding shell command into python.

May 4 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On May 4, 12:03 pm, pradeep nair <deep...@gmail.comwrote:
how to find out the present working directory using python.

os.system('pwd') works good. But i need some specific one in
python rather than embedding shell command into python.

os.path.getcwd()

May 4 '07 #2

P: n/a
On May 4, 12:05 pm, SamG <mad.vi...@gmail.comwrote:
On May 4, 12:03 pm, pradeep nair <deep...@gmail.comwrote:
how to find out the present working directory using python.
os.system('pwd') works good. But i need some specific one in
python rather than embedding shell command into python.

os.path.getcwd()


Thank u...

May 4 '07 #3

P: n/a
how to find out the present working directory using python.
Try this:

import os
os.getcwd()

It returns the current working directory.

Thanks,

- Isaac.

May 4 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.