Problem with Python on MAC OSX

edadk e.d.andersen at mosek.com
Tue Jun 29 03:33:07 EDT 2004


Hi

I have problem with Python on MAC OSX. The following code documents it

strib:~ eda$ pwd
/home/eda
strib:~ eda$ python
Python 2.3 (#1, Sep 13 2003, 00:49:11)
[GCC 3.3 20030304 (Apple Computer, Inc. build 1495)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> print os.getcwd()
/private/home/eda
>>>

Note I would have expected

print os.getcwd()

to print

/home/eda

Note that

>>> os.system('echo $PWD')
/home/eda
0

Of course /home/eda is a symbolic link to /private/home/eda. Is this a
bug or a feature? Is there a good way to work around it?

Regards

Erling



More information about the Python-list mailing list