On Wed, 13 Aug 2003 12:05 pm, Brian Hammond wrote:
> Also, it seems that
> os.path.isfile("~/Library/Frameworks/SDL.framework/Versions/Current/SDL")
> returns False even though it IS just a regular file.
os.path functions don't inherently support "~" expansion. Use the expanduser()
function to do that:
Python 2.2.3 (#2, Jul 10 2003, 17:50:55)
[GCC 3.3.1 (Mandrake Linux 9.2 3.3.1-0.2mdk)] on linux-i386
Type "help", "copyright", "credits" or "license" for more information.
>>> import os.path
>>> os.path.isfile('~/.pypirc')
0
>>> os.path.isfile('/home/richard/.pypirc')
1
>>> os.path.isfile(os.path.expanduser('~/.pypirc'))
1
>>>
Richard
Attachment:
pgp00000.pgp
Description: signature