Question on embedding. www.mcmillian-inc.com

Gordon McMillan gmcm at hypernet.com
Fri Jun 2 17:18:06 EDT 2000


Arinté <jamarijr at my-deja.com> wrote:
>
>I just looked at that web page and saw a sample of embedding.  The
>source is located here http://www.mcmillan-inc.com/embed2.html.  
I am
>not sure if I am reading this right, but it seems the c program runs
>the script by calling "doit" in the *.py file.  How would you call a
>*py file that didn't have any functions just the main thing.

When a file is first  imported, the top level stuff runs. So all you 
need is the PyImport_Import. Unless you want it to happen again 
in the same run.

- Gordon




More information about the Python-list mailing list