Calling Python functions from C from strings

Moshe Zadka moshez at math.huji.ac.il
Sat Mar 11 19:47:29 CET 2000


On Sat, 11 Mar 2000, Makhno wrote:

> And all I have is the string "mysub", how do I call this function?

Try the following:

m = PyImport...("__main__"); /* not sure exact name of function -- see
                                docs*/

Use the abstract protocol to get m.mysub

Now you have a PyObject *, so we solved your problem.

can-anyone-else-tell-i'm-a-mathematician-ly y'rs, Z.
--
Moshe Zadka <mzadka at geocities.com>. 
http://www.oreilly.com/news/prescod_0300.html





More information about the Python-list mailing list