Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > How to Parse a Script before execution

Reply
Thread Tools

How to Parse a Script before execution

 
 
Susanne
Guest
Posts: n/a
 
      12-08-2003
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
 
Reply With Quote
 
 
 
 
Susanne
Guest
Posts: n/a
 
      12-10-2003
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
 
Reply With Quote
 
 
 
 
Susanne
Guest
Posts: n/a
 
      12-10-2003
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Detect whether a key is being held before script execution? Thomas Wilson Ruby 3 04-14-2010 01:43 AM
Block execution of script while same script is already running MrBanabas@googlemail.com Ruby 2 12-17-2008 06:03 PM
Get cgi script to begin execution of another script... sophie_newbie Python 1 03-13-2008 02:52 PM
private data stashed in local/global execution context of PyEval_EvalCode disappears down the execution stack sndive@gmail.com Python 9 11-14-2007 10:31 PM



Advertisments