Re: Extending embedded Python: Adding single methods

2006-03-08 Thread Thomas Heller
Torsten Bronger wrote: > Hallöchen! > > Thomas Heller <[EMAIL PROTECTED]> writes: > >> Torsten Bronger wrote: >> >>> [...] However, is there a way to avoid this dummy "pp3" module >>> and add the C++ functions directy to the main namespace in the >>> Python script? >> Yes. You can import __buil

Re: Extending embedded Python: Adding single methods

2006-03-08 Thread Torsten Bronger
Hallöchen! Thomas Heller <[EMAIL PROTECTED]> writes: > Torsten Bronger wrote: > >> [...] However, is there a way to avoid this dummy "pp3" module >> and add the C++ functions directy to the main namespace in the >> Python script? > > Yes. You can import __builtin__, and add methods to it. This

Re: Extending embedded Python: Adding single methods

2006-03-08 Thread Thomas Heller
Torsten Bronger wrote: > Hallöchen! > > I'd like to script C++ funtions by an embedded Python interpreter. > So far, my C++ main() function contains: > > Py_Initialize(); > Py_InitModule("pp3", PythonMethods); > PyRun_SimpleString("from pp3 import *"); > PyRun_AnyFile(stdin, NULL); > Py

Extending embedded Python: Adding single methods

2006-03-08 Thread Torsten Bronger
Hallöchen! I'd like to script C++ funtions by an embedded Python interpreter. So far, my C++ main() function contains: Py_Initialize(); Py_InitModule("pp3", PythonMethods); PyRun_SimpleString("from pp3 import *"); PyRun_AnyFile(stdin, NULL); Py_Finalize(); "PythonMethods" is the vector