Empty sys.path[0]
Peter Hansen
peter at engcorp.com
Sat Jul 7 11:59:54 EDT 2001
More information about the Python-list mailing list
Sat Jul 7 11:59:54 EDT 2001
- Previous message (by thread): Empty sys.path[0]
- Next message (by thread): Empty sys.path[0]
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Michal Wallace wrote: > > On 7 Jul 2001, Gustaf Liljegren wrote: > > > The problem is that I can't find a way to get this directory. The > > docs say that sys.path[0] should be used for this, but that does > > only return an empty string. > > Where do the docs say this? It sounds like a mistake, or something > that needs clarification.. > > you want os.getcwd() It's more likely he wants something with sys.argv[0]. He wanted the directory of the Python script, which might not be the same as os.getcwd(). import sys, os x = os.path.abspath(sys.argv[0]) -- ---------------------- Peter Hansen, P.Eng. peter at engcorp.com
- Previous message (by thread): Empty sys.path[0]
- Next message (by thread): Empty sys.path[0]
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list