| | |
How to handle an aborted C function called from Python
Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Jun 2009
Posts: 1
Reputation:
Solved Threads: 0
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.
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.
•
•
Join Date: Jun 2008
Posts: 122
Reputation:
Solved Threads: 30
I would try this one:
http://docs.python.org/library/signal.html
http://docs.python.org/library/signal.html
•
•
Join Date: Dec 2006
Posts: 1,022
Reputation:
Solved Threads: 287
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
![]() |
Similar Threads
- Starting Python (Python)
- Is this a Function or Constant? (Python)
- calling Python function from C/C++ (Python)
- Send data on a serial port (C++)
- def function(): help (Python)
- Handling unicode values in python. (Python)
- Closure in Python (Python)
- Count Access to Function (Python)
- Windows programming - C - Save file function (C++)
- I lack focus... (Java)
Other Threads in the Python Forum
- Previous Thread: wxPython Vertical Aligning failing
- Next Thread: Jumble solver
| Thread Tools | Search this Thread |
advanced aliased bash beginner bits calling casino changecolor class clear command convert corners count csv cturtle cursor def definedlines dictionary digital dynamic dynamically event events examples external file float format frange function google gui hints homework i/o iframe import info input java line linux list lists loop matching mouse multiple number numbers obexftp output parsing path port prime programming projects py py2exe pygame pygtk python random rational raw_input recursion return scrolledtext signal singleton skinning stderr string strings subprocess table tails terminal text thread threading time tkinter tlapse tuple tutorial ubuntu unicode urllib urllib2 valueerror variable voip web-scrape whileloop word wxpython






