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""
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