Ben Sizer wrote:
Yes, this seems to fix it, thanks. But why? Can some Python guru
explain why these two dictionaries must be the same? (Or what steps we
must take if we want them to be separate?)
What's happening is that the import statement is binding
the name 'sys' in the locals, not the
In article b11e6e8a-98a6-43d1-b311-652fedbe7...@h5g2000yqh.googlegroups.com,
Ben Sizer kylo...@gmail.com wrote:
I have the following C++ code and am attempting to embed Python 2.5,
but although the import sys statement works, attempting to reference
sys.path from inside a function after that
On Jan 14, 4:37 pm, Ivan Illarionov ivan.illario...@gmail.com wrote:
On Jan 14, 1:49 pm, Ben Sizer kylo...@gmail.com wrote:
No, I don't want to do anything with sys.path apart from see it. I
just wanted my original question answered, not a guess at my intent
and a solution for something
On Jan 14, 1:55 am, Ivan Illarionov ivan.illario...@gmail.com wrote:
Ben Sizer kylo...@gmail.com wrote:
What am I doing wrong?
What are you trying to achieve?
If you want to modify sys.path I suggest using Python/C API directly:
No, I don't want to do anything with sys.path apart from see
On Jan 14, 1:49 pm, Ben Sizer kylo...@gmail.com wrote:
No, I don't want to do anything with sys.path apart from see it. I
just wanted my original question answered, not a guess at my intent
and a solution for something I'm not doing. ;) Thanks though!
Again - why can I not reference sys from
On Jan 14, 4:37 pm, Ivan Illarionov ivan.illario...@gmail.com wrote:
I would try to use ourNamespace_ dict for
both globals and locals in PyRun_String call.
I will try it when I get home. However I would like to be able to
treat them as separate dictionaries, as I want to be able to import
On Jan 14, 8:00 pm, Ben Sizer kylo...@gmail.com wrote:
I will try it when I get home. However I would like to be able to
treat them as separate dictionaries, as I want to be able to import
some symbols and modules at a global level, but be able to clear out
objects introduced at the local
On Jan 14, 8:17 pm, Ivan Illarionov ivan.illario...@gmail.com wrote:
On Jan 14, 8:00 pm, Ben Sizer kylo...@gmail.com wrote:
I will try it when I get home. However I would like to be able to
treat them as separate dictionaries, as I want to be able to import
some symbols and modules at a
I have the following C++ code and am attempting to embed Python 2.5,
but although the import sys statement works, attempting to reference
sys.path from inside a function after that point fails. It's as if
it's not treating it as a normal module but as any other global
variable which I'd have to
Ben Sizer kylo...@gmail.com wrote:
What am I doing wrong?
What are you trying to achieve?
If you want to modify sys.path I suggest using Python/C API directly:
(boilerplate removed)
PyImport_ImportModule(sys)
PyObject_GetAttrString(sysmod_pointer, path)
PyList_Insert(pathobj_pointer, 0,
Ivan Illarionov schrieb:
Ben Sizer kylo...@gmail.com wrote:
What am I doing wrong?
What are you trying to achieve?
If you want to modify sys.path I suggest using Python/C API directly:
(boilerplate removed)
PyImport_ImportModule(sys)
PyObject_GetAttrString(sysmod_pointer, path)
11 matches
Mail list logo