python-c-api
C++ Python embedding: Run on machine with no Python?
I\'m trying to make a small game that supports Python scripting. I\'ve no problems with using the Python C-API, but I don\'t know how to ensure that the game will r开发者_如何学Pythonun on a computer[详细]
2023-02-10 05:10 分类:问答Freeing a PyTuple object
What is the proper way to free a PyTuple object using the Python C-API? I know that tuples are somewhat special when it comes to the reference counting semantics, since PyTuple_SetItem \"steals\" the[详细]
2023-02-09 02:34 分类:问答Py_INCREF/DECREF: When
Is one correct in stating the following: If a Python object is created in a C function, but the function doesn\'t return it, no INCREF is needed, but a DECREF is.[详细]
2023-02-03 09:45 分类:问答Python 3 C-API IO and File Execution
I am having some serious trouble getting a Python 2 based C++ engine to work in Python3. I know the whole IO stack has changed, but everything I seem to try just ends up in failure. Below is the pre-c[详细]
2023-02-02 08:07 分类:问答How can I assert from Python C code?
I\'m writing a Python class in C and I wa开发者_Go百科nt to put assertions in my debug code. assert.h suits me fine. This only gets put in debug compiles so there\'s no chance of an assert failure imp[详细]
2023-02-01 03:35 分类:问答What are the implications of calling NumPy's C API functions from multiple threads?
This is risky business, and I understand the Global Interpreter Loc开发者_如何学JAVAk to be a formidable foe of parallelism. However, if I\'m using NumPy\'s C API (specifically the PyArray_DATA macro[详细]
2023-01-29 10:13 分类:问答Python C API: Call a Python function with argument(s) passed by reference
I\'m writing a python module in C and I need to开发者_JAVA百科 have it call a Python function with one of the arguments passed by \"reference\".The end result should be that what the Python function d[详细]
2023-01-28 11:47 分类:问答How to redirect python interpreter output and catch it in a string in C++ program?
i am using python C++ API to run python开发者_运维百科 commands from C++ program. I want to catch all the python output to a string, I\'ve managed by the following redirection, to catch pythons stdout[详细]
2023-01-28 01:09 分类:问答How To catch python stdout in c++ code
I have a program which during it\'s run sometimes needs to call python in order to preform some tasks. I need a function that calls python and catches pythons stdout and puts it in some file.[详细]
2023-01-27 06:14 分类:问答Tried to embed python in a visual studio 2010 c++ file, exits with code 1
I am trying to embed some python code in a c++ application i am developing with ms visual studio c++ 2010. But when i run the program, it exits with code 0x01 when i call Py_initialize().[详细]
2023-01-25 14:26 分类:问答