Re: [C++-sig] Beginner - PyObject_CallObject fails because imported module is not recognized

2016-01-06 Thread Stefan Seefeld
Hi Christian, for the sake of simplicity I have transcribed your example to pure Python, which also exhibits the same behavior: #!/usr/bin/env python script = """import pprint import sys counter= 0 def onInitialize(ctxt): global counter counter+=1 pprint.pprint(sys.path) return counter""

[C++-sig] Beginner - PyObject_CallObject fails because imported module is not recognized

2016-01-06 Thread BERGER Christian
We have this simple (test) script that defines a function that we want to call via python's c api: import pprint import sys counter= 0 def onInitialize(ctxt): global counter counter+=1 pprint.pprint(sys.path) return counter While executing this works fine from the python command line