Re: How to embed Python in an application?

sebastiano vigna (vigna@pippo.sm.dsi.unimi.it)
24 Mar 1995 10:44:26 +0100

>Maybe give an overview of how you would like to structure the Python
>integration (ie, will Python become the core editor functionality, or will
>just extensions to the editor be written in Python, etc. Then, we can give
>some specific suggestions. I have embedded Python in a reasonably large
>application (which includes a _really_ basic editor - autoindent is about
>its only feature :)

OK. The idea is to have a language in which the user can play scripts
and/or extend the editor features. A basic set (such as insertion/deletion of
lines/chars, find, replace, indentation, wordwrap etc.) is supplied
under the form of basic commands. Presently the editor is installed and
working on hundreds of sites, so the set is enough for any standard
purpose. The users presently can only extend the editor features
by writing scripts, i.e., ordered lists of commands. But there are
no control structures, or argument passing.

I would like to let the user write his own commands, by giving also
specific script commands like GETLINE, GETCHAR and GETWORD, which
would return the current line/char/word the cursor is on.

If I write a module, will EVERY script have to start with an
"import" command?

Moreover, where can I find the references to the functions which RUN
Python scripts from disk and/or from RAM?

>What platforms will your editor run on?

UNIX. Any flavour of...

seba