python-c-extension
Python: Usage of PyDateTime_FromTimestamp
I\'m working on a python c-extension and want to create an instance of python datetime object with a unix timestamp.[详细]
2023-04-01 03:01 分类:问答Compiler can't find Python.h
I\'m kinda new to C, and I can\'t seem to do what I want. I need to make some Python bindings for C functions, and I think I can figure this out. But there\'s one little line that WILL NOT WORK.[详细]
2023-03-29 02:56 分类:问答problem redirecting stdout of C functions when imported in python
I wrote a simple C module which prints to stdout using printf. // sample.c func_print() { printf(\"Hello World!\\n\");[详细]
2023-03-19 06:12 分类:问答Docstrings in C extensions to Python?
When creating a C extension to Python, is it possible to be able to somehow write comments that are exposed as docstrings to users of the开发者_如何学运维 extension? Docstrings for types can be includ[详细]
2023-03-11 01:50 分类:问答Returning objects to Python from C
I\'ve read the documentation for the Python C-API, and even written a few extension modules.However, I\'m still a bit unclear on the exact semantics when it comes to returning Python objects from a C[详细]
2023-03-09 01:17 分类:问答can't import python extension
I\'m trying to learn python extensions, and I created the simple noddy example c file and setup.py. python.exe setup.py buildgives me:[详细]
2023-02-10 02:35 分类:问答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 分类:问答How do I create a fixed-length, mutable array of Python objects in Cython?
I need to have an array of python objects to be used in creating a trie datastructure.I need a structure that will be fixed-length like a tuple and mutable like a list.I don\'t want to use a list beca[详细]
2023-02-07 21:41 分类:问答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 分类:问答alternatives to DYLD_LIBRARY_PATH/LD_LIBRARY_PATH
I\'m developing python C++ extensions for use in both OSX and linux. Currently, I can run my code with a wrapper script wrapper.sh:[详细]
2023-01-30 19:07 分类:问答