Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Check from C that Interpreter is running

Reply
Thread Tools

Check from C that Interpreter is running

 
 
Florian Schulze
Guest
Posts: n/a
 
      07-22-2003
Hi!

I want to check from C that the Python Interpreter is still running and
it's save to call things like PySys_GetObject, PyFile_WriteString etc. I
need this in a C function which might be called during shutdown in a
program embedding Python. Currently I get this error:

Fatal Python error: PyThreadState_Get: no current thread
Abort!

Regards,
Florian
 
Reply With Quote
 
 
 
 
Michael Hudson
Guest
Posts: n/a
 
      07-22-2003
Florian Schulze <> writes:

> Hi!
>
> I want to check from C that the Python Interpreter is still running
> and it's save to call things like PySys_GetObject, PyFile_WriteString
> etc. I need this in a C function which might be called during shutdown
> in a program embedding Python. Currently I get this error:
>
> Fatal Python error: PyThreadState_Get: no current thread
> Abort!


Py_IsInitialized?

Cheers,
mwh

--
The proponent of the PEP shall be placed in a gladiatorial arena
together with half a dozen hungry lions, and permitted to debate
the merits of the proposal with them.
-- Greg Ewing, comp.lang.python
 
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
problem in running a basic code in python 3.3.0 that includes HTML file Satabdi Mukherjee Python 1 04-04-2013 07:48 PM
Check in interpreter if running a debug version of python John Reid Python 0 07-27-2010 02:06 PM
Can I check if I'm running from the interpreter prompt? skip@pobox.com Python 3 11-15-2008 03:11 AM
Python embedded interpreter: how to initialize the interpreter ? ycollet@freesurf.fr Python 3 01-03-2007 01:00 AM
check interpreter version before running script rbt Python 8 04-06-2005 01:21 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57