python-extensions Questions
1
Solved
I would like to pass as argument of a function in my C module an array of uint8_t's.
I couldn't find a method to directly parse this array, so I'm parsing it to a PyObject_t and then iterating as...
Armilla asked 26/4, 2016 at 15:51
2
Solved
I was writing code to store a (potentially) very large integer value into an array of chars referenced by a pointer. My code looks like this:
cdef class Variable:
cdef unsigned int Length
cdef ...
Siberson asked 3/9, 2015 at 9:31
2
Solved
I am writing C extensions for python. I am just experimenting for the time being and I have written a hello world extension that looks like this :
#include <Python2.7/Python.h>
static PyOb...
Berserk asked 7/10, 2015 at 11:33
2
I am writing a python/C++ application, that will call methods in C++ extension from python.
Say my C++ has a class:
class A
{
private:
int _i;
public:
A(int i){_i=i;}
int get_i(){return _i;}...
Markham asked 13/7, 2015 at 19:3
3
Solved
I have medium amateur skills in Python and I'm beginner in asm and haven't any knowledge of C-language.
I know that python C-extensions must follow specific interface to work fine.
Is this possib...
Wulfila asked 27/1, 2013 at 10:50
2
I wrapped some C code for Python and it works. The C module creates a handle, which I pass to Python as PyCapsule. The API I would like to have can be made in Python like:
import wrapped
class Te...
Affranchise asked 3/2, 2015 at 9:40
3
Solved
I'm attempting to build a Python extension from Fortran source using Numpy's f2py.py script. I'm following the steps from http://www.scipy.org/F2PY_Windows (web archive). My system is Windows 7 64-...
Tempest asked 5/6, 2013 at 0:15
2
Solved
Short version
I recently came across some Python code in which the return type for a function was specified as PyObject in the documentation. What is a PyObject?
Detailed version
I am not a C/C++ p...
Shaum asked 29/12, 2014 at 5:18
1
Solved
I'm just trying to start off by creating a numpy array before I even start to write my extension. Here is a super simple program:
#include <stdio.h>
#include <iostream>
#include "Pytho...
Gratification asked 25/8, 2014 at 21:46
1
Solved
I see in docs, that I can build tuple value with int (specifying 'i'). I need to make tuple with bool, e.g. (True, 10). How can I make such tuple with bool (what specifier needed)?
Broach asked 19/1, 2014 at 19:6
1
I am in the process of extending the classes in our library
(which supports Python 2.7) to support PEP 3118, which has been
back-ported to 2.7.
From the documentation, I need to
initialize the tp...
Envelopment asked 7/10, 2013 at 11:29
1
Solved
I want to create a Python extension and I really like the idea of using Cython. Mainly to gain more knowledge about it and to take advantage of speed gains, if any. I have read quite a bit of Cytho...
Teresaterese asked 21/12, 2012 at 16:43
2
Solved
Possible Duplicate:
Any AOP support library for Python?
I am familiar with the AspectJ extension for the Java language.
I want to know if there is such a thing for Python.
Don't get me w...
Lemniscus asked 10/9, 2012 at 17:33
1
Solved
I have a Python project with many sub-modules that I package up with distutils. I would like to build some Python extensions in C to live in some of these sub-modules but I don't understand how to ...
Fastening asked 23/8, 2012 at 18:17
1
Perhaps a stupid question:
how can one specify docstring for special functions like __init__ when writing a C extension?
For ordinary methods, method table has provision for docstrings. The followi...
Mafia asked 11/8, 2012 at 9:27
2
Solved
I have Python extension module written in C. I want to use in this C code one of the standard Python modules, for example os or shutil. How is best to do this?
Nalepka asked 11/2, 2012 at 4:39
2
Solved
I'm trying to create a script in python that sends data through a parallel port. I'm creating my own module in C language.
The problem is: when I try to execute my module, python crashes. No error...
Freyah asked 9/12, 2011 at 19:11
1
Solved
For performance reasons I want to port parts of my python program to C++ and I therefore try to write a simple extension for my program. The C++ part will build a dictionary, which then needs to be...
Servitude asked 8/12, 2011 at 17:4
1
I am using Cython (0.15.2) to create an extension for Python (2.6.5). I have created a pxd file and a pyx file. Here are the contents of my pyx file:
cimport capifuncs
cdef class myArray:
cdef c...
Presumable asked 7/11, 2011 at 17:55
1
Solved
I have written an extension module that uses C++ function pointers to store sequences of function calls. I want to 'run' these call sequences in separate processes using python's multiprocessing mo...
Hooked asked 20/8, 2011 at 3:2
2
Solved
Last edit: I've figured out what the problem was (see my own answer below) but I cannot mark the question as answered, it would seem. If someone can answer the questions I have in my answer below, ...
Argentite asked 15/12, 2010 at 15:58
4
The Python community has published helpful reference material showing how to profile Python code, and the technical details of Python extensions in C or in Cython. I am still searching for tutorial...
Reach asked 15/11, 2010 at 22:8
1
Solved
Say I have my object layout defined as:
typedef struct {
PyObject_HEAD
// Other stuff...
} pyfoo;
...and my type definition:
static PyTypeObject pyfoo_T = {
PyObject_HEAD_INIT(NULL)
// ...
...
Traverse asked 12/11, 2010 at 9:6
1
Solved
I am trying to write a python wrapper for a C function. After writing all the code, and getting it to compile, Python can't import the module. I am following the example given here. I reproduce it ...
Brittaney asked 6/11, 2010 at 7:52
© 2022 - 2024 — McMap. All rights reserved.