Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Python
what are PyObject *globals and PyObject *locals ?
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Olivier Sessink, post: 1806941"] Hi all, I want to make a value available to the global namespace of an embedded python interpreter. Several functions of the Python/C API feature a PyObject *globals and a PyObject *locals, so my guess is that these can be used for this purpose. Unfortunately, the Python/C API does not describe how this works. If I want for example, to create a variable MyVar that can be read by the python code in some filename, to be run with PyRun_AnyFile();, how can I do this? Or do I misunderstand the API, and can Py_InitModule() register both functions *and* variables? (and how to register the variable then?) regards, Olivier (I know extending is the preferred solution, unfortunately I was not aware of this some years ago) ------------ And now a word from our sponsor ------------------ For a quality usenet news server, try DNEWS, easy to install, fast, efficient and reliable. For home servers or carrier class installations with millions of users it will allow you to grow! ---- See [URL]http://netwinsite.com/sponsor/sponsor_dnews.htm[/URL] ---- [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Python
what are PyObject *globals and PyObject *locals ?
Top