I tried this (PYCHECK does some error checking): PyObject *pymodMain; PyObject *pymodRe; Py_Initialize(); pymodMain = PyImport_ImportModule("__main__"); globals = PyModule_GetDict(pymodMain); locals = PyDict_New(); PyRun_String("import re", Py_file_input, globals, locals); PYCHECK; Then I run: PyRun_String("print globals()", Py_file_input, globals, locals); and get: {'__doc__': None, '__name__': '__main__', '__builtins__': <module '__builtin__' (built-in)>} You see that 're' is not in globals. Why? How do I have to import re such that it is available for example to string I run with PyRun_String? Harald Kirsch -- ----------------+------------------------------------------------------ Harald Kirsch | kirschh at lionbioscience.com | "How old is the epsilon?" LION bioscience | +49 6221 4038 172 | -- Paul Erdös
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4