How to use the evaluate the code object returned byPyParser_Simp leParseString function?

B

Borse, Ganesh

Hi,

Can someone please help me in the following question?
On the web page http://olympus.het.brown.edu/cgi-bin/info2www?(python2.3-api)Very+High+Level+Layer, I got the following information:

`struct _node* PyParser_SimpleParseString(char *str, int start)'
Parse Python source code from STR using the start token START. The result can be used to create a code object which can be evaluated efficiently.
This is useful if a code fragment must be evaluated many times.

I have exactly same requirement. I have dynamic expressions loaded from database at startup in my C++ application.
I want to parse these expressions at startup & keep the parsed (compiled) code in memory of this application.
Then at runtime, I want to evaluate all this parsed code. This has to be very efficient.

So, which function should be used for evaluating the parsed code generated by PyParser_SimpleParseString?
Do I need to use the "struct _node*" returned by PyParser_SimpleParseString?

Any example of this use would be more helpful?

Thanks in advance for guidance & help.

Warm Regards,
Ganesh

==============================================================================
Please access the attached hyperlink for an important electronic communications disclaimer:

http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
==============================================================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top