IDLE: What to use instead of sys.argv[0] ?

Sam Schulenburg samschul at pacbell.net
Sat Aug 28 20:11:09 CEST 1999


"E:\local\Python\Tools\idle\idle.pyw" is the default startup path for IDLE.
i.e. The present distribution places IDLE in the Tools\idle directory.
If what you want is the path of the present script that is loaded, it will
be returned by
sys.path. The problem with this, is that you get all the paths :>)
Sam Schulenburg

Svante Kleist <Svante.Kleist at NEMESIS.se> wrote in message
news:MPG.1231b572a3fb6029989682 at news.pi.se...
>
> Dear Pythoneers,
>
> From within a Python script executed in IDLE, how can I get
> its path/file? sys.argv[0] gives me this:
>
> E:\local\Python\Tools\idle\idle.pyw
>
> Thanks for any tip.
>
> / Svante Kleist - NEMESIS systemDesign, Stockholm






More information about the Python-list mailing list