| | |
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: 128
Reputation:
Solved Threads: 31
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,065
Reputation:
Solved Threads: 300
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 |
Tag cloud for Python
alarm assignment avogadro beginner bluetooth character cmd code copy customdialog cx-freeze data decimals dictionary directory dynamic error examples excel exe file float format ftp function generator gnu graphics gui halp homework http ideas import input itunes java leftmouse line linux list lists logging loop module mouse newb number numbers output parsing path port prime program programming projects push py2exe pygame pyglet pyqt python random recursion recursive schedule screensaverloopinactive script scrolledtext search sqlite ssh stdout string strings sudokusolver table terminal text thread threading time tkinter tlapse tuple tutorial ubuntu unicode update urllib urllib2 variable ventrilo verify webservice wikipedia windows wxpython xlib






