Calling Python Code Snippets within Python Application

Marc Floessel gildemere at hotmail.com
Mon Apr 14 05:43:54 EDT 2003


This is very likely a newbie question, but I'd still appreciate a
pointer. I need to call Python Code snippets (saved in a file/database
etc) within my main Python Application. I would like to do the
following things:

- Code Snippet should not have access to or knowledge of Main
Application variables and methods - ie. each code snippet has its own
private scope
- main application exposes a number of specific methods and variables
("environment") to the snippet that it can use
- a way for the code snippet to return some variables (ie. a success
bool) - possibly using (re-importing back from the snippet) the
variables exposed by the main application

In which direction should I look?

Thanks a lot,
Marc Floessel




More information about the Python-list mailing list