[wxPython-users] sys.path adjusted?
Jorgen Bodde
jorgen.maillist at gmail.com
Sun Nov 11 06:42:02 PST 2007
Hi Karsten,
sys.argv[0] is not always reporting the proper path and it depends on
how the script is executed.
>From the documentation:
The list of command line arguments passed to a Python script.
argv[0] is the script name (it is operating
system dependent whether this is a full pathname or not).
The sys.path documentation:
As initialized upon program startup, the first item of this list,
path[0], is the directory containing the script
that was used to invoke the Python interpreter.
The only reason when sys.path is not present is when in an interpreter
or auto invoke, otherwise they state in the documentation what
sys.path[0] is.
So to keep that path correct I see no reason why wxPython cannot
append the path either at the end or one place after the sys.path[0].
Regards,
- Jorgen
On Nov 11, 2007 3:19 PM, Karsten Hilbert <Karsten.Hilbert at gmx.net> wrote:
> On Sun, Nov 11, 2007 at 11:57:32AM +0100, Jorgen Bodde wrote:
>
> > I would like to use sys.path[0] as my execution path for my script,
>
> You might want to consider sys.argv[0].
>
> Karsten
> --
> GPG key ID E4071346 @ wwwkeys.pgp.net
> E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wxPython-users-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail: wxPython-users-help at lists.wxwidgets.org
>
>
More information about the wxpython-users
mailing list