Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #81346 > unrolled thread

Embedded python 'scripting engine' inside Python app

Started byPatrick Stinson <patrickkidd@gmail.com>
First post2014-11-22 20:48 -0900
Last post2014-11-22 20:48 -0900
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python


Contents

  Embedded python 'scripting engine' inside Python app Patrick Stinson <patrickkidd@gmail.com> - 2014-11-22 20:48 -0900

#81346 — Embedded python 'scripting engine' inside Python app

FromPatrick Stinson <patrickkidd@gmail.com>
Date2014-11-22 20:48 -0900
SubjectEmbedded python 'scripting engine' inside Python app
Message-ID<mailman.16172.1416733471.18130.python-list@python.org>
I am writing a python app (using PyQt, but that’s not important here), and want my users to be able to write their own scripts to automate the app’s functioning using an engine API hat I expose. I have extensive experience doing this in a C++ app with the CPython api, but have no idea how to do this outside of calling exec() from with in Python :)

Ideally their script would compile when the source changes and retain it’s state and respond to callbacks from the api object. It appears this won’t work with exec() because the script’s definitions and state disappear as soon as the exec() call is complete, and the script doesn’t seem to be able to access it’s own defined functions and classes.

Thoughts? Fun stuff!

Thanks!

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web