Python/C and PYTHONPATH
Tero Pihlajakoski
tepihlaj at NOpaju.SPAMoulu.fi
Mon Jan 5 17:39:19 EST 2004
Samuel Walters <swalters_usenet at yahoo.com> wrote:
> Fair warning: At this point, I couldn't even get the example you quoted
> to link properly. Of course, I didn't dig too deep, as I'm in a hurry.
> ---code---
... snip ...
> Or, call setenv ("man 3 setenv") to manually set a python-path.
> you can use that in combo with getenv ("man 3 getenv") to append to an
> existing PYTHONPATH, if you so choose.
> Give it a go, please let me know how it turns out. If this doesn't shed
> some light on the matter I might have another idea once I'm not rushing
> around.
(Sorry for the delay, I was offline)
I'll see if it's actually the C-part that's causing problems, but I
worked it around by adding:
PyRun_SimpleString("import sys\nsys.path.insert(0,'')");
right after the Py_Initialize().
Works ok. Guess I'm "allowed" to do that(?)
Thanks,
- Tero
--
More information about the Python-list
mailing list