How to handle an aborted C function called from Python

Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Jun 2009
Posts: 1
Reputation: RDCooter is an unknown quantity at this point 
Solved Threads: 0
RDCooter RDCooter is offline Offline
Newbie Poster

How to handle an aborted C function called from Python

 
0
  #1
Jun 2nd, 2009
Just started working on a project that is using Python to drive C API's. When the C API's take an unhandled event they terminate using a C exit(3).

How can I monitor for these exit conditions with in my Python code and handle and process the error code used in the C functions exit?

I have searched around and tried many of the exception classes to no avail.
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 122
Reputation: slate is an unknown quantity at this point 
Solved Threads: 30
slate slate is offline Offline
Junior Poster

Re: How to handle an aborted C function called from Python

 
0
  #2
Jun 2nd, 2009
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 1,022
Reputation: woooee is a jewel in the rough woooee is a jewel in the rough woooee is a jewel in the rough 
Solved Threads: 287
woooee woooee is offline Offline
Veteran Poster

Re: How to handle an aborted C function called from Python

 
0
  #3
Jun 2nd, 2009
If possible, set it up so you can call/execute the C functions using subprocess. See "Reading from the output of a pipe:" here http://www.doughellmann.com/PyMOTW/s...ule-subprocess
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC