473,386 Members | 1,810 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Check from C that Interpreter is running

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
Jul 18 '05 #1
1 1675
Florian Schulze <fl*******************@gmx.net> 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
Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Atul Kshirsagar | last post by:
I am embedding python in my C++ application. I am using Python *2.3.2* with a C++ extention DLL in multi-threaded environment. I am using SWIG-1.3.19 to generate C++ to Python interface. Now to...
16
by: Neil Benn | last post by:
Hello, I'm looking at a small app which would need a very quick startup time for the Python interpreter. It doesn't do much (copying and caching of files, no GUI) but I need the Python...
12
by: Anon | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello all I am a beginner teaching myself python, and I am enjoying it immensely :) As a language it is great, I real treat to study, I actually...
3
by: Tomas Christiansen | last post by:
Excaclty HOW global is the global interpreter lock? I know that it isn't global in the meaning "the hole world" (imagine that!), but is it global only to each task/job/python interpreter instance...
8
by: rbt | last post by:
Is there a recommended or 'Best Practices' way of checking the version of python before running scripts? I have scripts that use the os.walk() feature (introduced in 2.3) and users running 2.2 who...
12
by: Rex Eastbourne | last post by:
Hi, I'm interested in running a Python interpreter in Emacs. I have Python extensions for Emacs, and my python menu lists "C-c !" as the command to run the interpreter. Yet when I run it I get...
0
by: Duncan Grisby | last post by:
Hi, I have encountered a problem with the re module. I have a multi-threaded program that does lots of regular expression searching, with some relatively complex regular expressions....
0
by: Robert Kern | last post by:
Ognjen Bezanov wrote: Mostly. It is worth noting, though, that the Python bytecode is at a higher level than Java bytecode. You can run other languages on top of the JVM using Java bytecode...
4
by: skip | last post by:
Is there a reliable way (this is on Solaris if that matters) to tell if I'm running in the interactive interpreter as opposed to in a script? I think examining sys.argv works, but wanted to double...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.