HOWTO : Py_CompileString !?!?!

Jp Calderone exarkun at intarweb.us
Wed Jan 29 18:37:05 EST 2003


On Wed, Jan 29, 2003 at 02:43:38PM -0500, Luc wrote:
> Hello fellow python user :)
> 
> I'm quite new to this so please be kind to my newbie question !!!
> 
> I'm trying to embed python in my C++ application. I have a python source 
> file names test.py and what I want to do is first try to compile it to 
> see if any syntax error or import error occurs.  I tried to use 
> Py_CompileString but it seems not to work. I added a syntax error and it 
> still report no error. Now I just thought that because it's interpreted, 
> does it mean that the error is caught until the script is actually run 
> ??? If so, is there any method that I could use to detect such error 
> without resorting to running the script ???
> 

  It's impossible to say what's going wrong without seeing at least a
minimal sample of your code.  Can you post the shortest snippet possible
that completely duplicates the behavior you believe to be incorrect?  If so,
we can look at it and point out in particular where your expectations don't
coincide with the actual behavior.

  Jp

-- 
|     This 
|   signature
| intentionally
|    8 lines
|     long.
|  (So sue me)
---
-- 
 up 45 days, 3:49, 3 users, load average: 0.00, 0.07, 0.11
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20030129/16a99694/attachment.sig>


More information about the Python-list mailing list