On Thu, 9 Mar 2000, Chen Shapira wrote:

> I was always wondering how does one go about adding scripting capabilites to
> a program.
> Does anyone know of any resources about the subject?

You already know my biases, and there is very good documentaation on
www.python.org about that (look for the extending and embedding tutorial).
Basically, what you do is:

1. Link Python into your program.
2. Expose hooks into your program as a new built-in Python module.
3. Give user level commands (selecting menus, etc.) for running arbitrary
   scripts.

However, I do urge you to consider an alternative solution: implement the
application in Python, and wrap system libraries you need as Python
modules (www.swig.org). Then you already have plenty of hooks into Python,
so you just need the user-level commands to run Python scripts, which is
easy.

As an example, consider how IDLE is built (IDLE is the Python IDE)

biased-ly y'rs, Z.

--
Moshe Zadka <[EMAIL PROTECTED]>. 
http://www.oreilly.com/news/prescod_0300.html


=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to