How to Parse a Script before execution

S

Susanne

Hello,

i need some help with python.
I have written some c++ extensions for python, and i can execute a
script, calling this functions. (PyRun_SimpleFile)

Now my problem is, that i want to parse the script first, because i
want
to know, if there are any wrong arguments (e.g. not the right number
of arguments, or of wrong type (int, char* etc.)).

PyRun_SimpleFile tells me, whether there is an error, but
it executes all calls before the wrong one.

Can anyone give me a hint?

PyParser_SimpleParseFile is not, what i am looking for!!

Thanks a lot.
Susanne
 
S

Susanne

Hello,

i was looking for a solution in the groups, and
someone did it with:

struct _node * myNode = PyParser_SimpleParseFile(...);
PyNode_Compile(myNode);
PyEval_EvalCode(...);

I am using Python 2.3 and there my Visual Compiler says, that there
is no PyNode_Compile().

I also looked i different books, and in the html-help of
Python 2.3, but found nothing usable.

Perhaps anyone of you has an idea, how to solve my problem.

Thanks
Susanne
 
S

Susanne

Hello,

i was looking for a solution in the groups, and
someone did it with:

struct _node * myNode = PyParser_SimpleParseFile(...);
PyNode_Compile(myNode);
PyEval_EvalCode(...);

I am using Python 2.3 and there my Visual Compiler says, that there
is no PyNode_Compile().

I also looked into different books, and in the html-help of
Python 2.3, but found nothing usable.

Perhaps anyone of you has an idea, how to solve my problem.

Thanks
Susanne
 

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,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top