[Tutor] getting 'pwd' for XP ?

Shantanoo Mahajan shantanoo at gmail.com
Thu Sep 28 20:44:16 CEST 2006


+++ Shantanoo Mahajan [28-09-06 21:12 +0530]:
| +++ Dave S [28-09-06 16:10 +0100]:
| | I currently running XP (like a fish out of water :) and I need to know the dir 
| | that the python script is executed from. a linux 'pwd' How can I achieve 
| | this - I have looked in sys & os & os.path but found nothing suitable
| 
| ====================
| Python 2.4.3 (#2, Sep 26 2006, 15:27:42)
| [GCC 3.4.4 [FreeBSD] 20050518] on freebsd6
| Type "help", "copyright", "credits" or "license" for more information.
| >>> import os
| >>> os.getcwd()
| '/tmp'
| >>>  
| ====================

And I do not remember exactly whether it will work or not, but you may
try 'cd' instead of 'pwd' on windows. I do not have windows machine to
test, so cannot confirm whether it works or not.

-- 
Research is what I'm doing when I don't know what I'm doing. ~Wernher von Braun


More information about the Tutor mailing list