Skip to main content
Filter by
Sorted by
Tagged with
1 vote
2 answers
169 views

I'd like to invoke PySocketModule_ImportModuleAndAPI function defined in socketmodule.h in my Python C-extension.
Dmitry Trofimov's user avatar
1 vote
1 answer
791 views

Maybe I'm missing something, but here is a problem: I'm tracing python code by C extensions and my trace function got PyFrameObject* frame. Now I want to process the frame by Python code(embedded or ...
Dmitry Trofimov's user avatar
4 votes
2 answers
1k views

I have a C program with embedded python code. I have compiled python 2.7.2 from source and linked my program against libpython2.7.a. Now in my python code I wish to call back functions from other C ...
Avner's user avatar
  • 5,841
4 votes
2 answers
1k views

I've defined a custom build_ext to build a funky extension that I'm trying to make pip-friendly. The following is a trimmed version of what I'm doing. foo_ext = Extension( name='foo/_foo', ...
sholsapp's user avatar
  • 16.2k
3 votes
1 answer
773 views

Using the method discussed in question 972, I was unable to monkey patch the cursor() method in psycopg: Tried to patch a methond in psycopg2 with types but it did not work: >>> import ...
Lester Cheung's user avatar
6 votes
2 answers
2k views

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?
zaharpopov's user avatar
  • 17.4k
-1 votes
3 answers
866 views

I have a python object which accesses and downloads some text via HTTP. I'm running this python object, and processing that text, using a c++ code. I.e. /* CPPCode.cxx */ int main(...) { for(int ...
DilithiumMatrix's user avatar
1 vote
0 answers
181 views

We are writing SFCB providers in python, Since SFCB talks to only C++ providers we need to have an intermediate layer(cmpi-bindings, a python extension module) which can talk to SFCB and start the ...
Rohit Srivastava's user avatar
1 vote
1 answer
1k views

I'm trying to build a Python extension and package it up using distutils but the extension installs in the root package no matter how I name it. My directory layout looks like this: foo/bar/...
Rich's user avatar
  • 12.8k
14 votes
2 answers
12k views

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 errors, ...
markmb's user avatar
  • 902
10 votes
1 answer
7k views

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 ...
tobigue's user avatar
  • 3,617
1 vote
0 answers
421 views

I am writing a Python extension for an existing library. Some of the functions accept a pointer to a primitive, so the arg can act as output. This is not very pythonic, so I want to use typemaps as ...
Homunculus Reticulli's user avatar
2 votes
3 answers
1k views

I am using SWIG to generate Python language bindings to my C library. I have managed to build the bindings and exported data structures, but I'm having to jump through some hoops when using the ...
Homunculus Reticulli's user avatar
7 votes
1 answer
6k views

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 ...
Homunculus Reticulli's user avatar
2 votes
1 answer
893 views

I have just managed to build my first C extension for Python, using Cython to call into an existing C library. I declared and defined my data types and functions into logical components (following ...
Homunculus Reticulli's user avatar
1 vote
1 answer
271 views

I am trying to build my fisrt python extension, using Cython. My C files are partitioned logically, and the functionality is "nested" - in that module C depends on functions defined in module B, ...
Homunculus Reticulli's user avatar
50 votes
9 answers
24k views

I have just compiled part of my C library as an extension using Cython, as a "proof of concept". I managed to hack the code (const correctnes problems etc aside), to finally get an extension built. ...
Homunculus Reticulli's user avatar
0 votes
1 answer
544 views

I am experimenting with Cython to write a python extension for my C library. I have created a setup.py file - but when I try to build my pxd and pyx files, I get an error. After some investigation, ...
Homunculus Reticulli's user avatar
3 votes
2 answers
9k views

I'm trying to use scapy on win32 python2.7 I've manage to compile all the other dependencies expect this one can some help in the goal of reaching this executable ? "dnet-1.12.win32-py2.7.exe" (I ...
Fruch's user avatar
  • 468
5 votes
1 answer
3k views

I'm trying to build a python extension with cmake. This is the cmake list: cmake_minimum_required(VERSION 2.8) PROJECT(drtile) set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) find_package(Vigra ...
Luca Fiaschi's user avatar
  • 3,215
6 votes
1 answer
607 views

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 ...
vsekhar's user avatar
  • 5,600
1 vote
1 answer
209 views

I have gone through and defined my new types, stored them in a pytypeobject and called the following functions (after initializing the interpreter): PyType_Ready(); //this takes my defined typed ...
DaneEC117's user avatar
  • 237
2 votes
1 answer
2k views

It's simple to create a member for an object in a Python C extension with a base type of char *, using the T_STRING define in the PyMemberDef declaration. Why does there not seem to be an equivalent ...
JAB's user avatar
  • 21.2k
2 votes
1 answer
3k views

I've been trying to make a Python extension for Upskirt. I though it would not be too hard for a first C project since there are examples (example program in the Upskirt code and the Ruby extension). ...
Frank's user avatar
  • 406
1 vote
1 answer
504 views

I'm trying to create C code that creates an Python xmlrpc client and calls methods on the xmlrpc server (I'm thinking of using this as IPC for a hook DLL). Here's the code ... I'm not going to layer ...
MikeRand's user avatar
  • 4,878
1 vote
1 answer
327 views

I have a two-part event generator: pyglobalexe (a stub to simulate events): #pragma comment(lib, "pyglobalextension.lib") #include <Python.h> __declspec(dllimport) PyObject* ...
MikeRand's user avatar
  • 4,878
7 votes
2 answers
729 views

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, ...
Michael Trausch's user avatar
25 votes
4 answers
2k views

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 tutorials ...
gotgenes's user avatar
  • 40.3k
53 votes
1 answer
23k views

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) /...
detly's user avatar
  • 30.6k
2 votes
2 answers
1k views

Following this example, I've created a little hello.pyd library file, the contents of which are at the end of this question. When I enter python interpreter I get the following: D:\test\build\lib....
Jonathan Livni's user avatar
8 votes
1 answer
10k views

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 ...
highBandWidth's user avatar
0 votes
1 answer
783 views

WHen specifying library_dirs in a Python distutils.core.Extension I get this error when trying to build: /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/dist.py:263: ...
None's user avatar
  • 3,973
0 votes
2 answers
779 views

I'm working on making my first Python C extension, which defines a few functions and custom types. The strange thing is that the custom types are working, but not the regular functions. The top-...
Nik Reiman's user avatar
  • 40.7k
3 votes
1 answer
1k views

I've got two different Python extension modules; let's call them A and B. Module A contains a storage class type called container that I want to use within Module B as the return type of a class ...
Paul D.'s user avatar
  • 1,845
4 votes
2 answers
4k views

I want to know what is the current url of active tab in running firefox instance from python module. Does FireFox have any API for this and does python know to work with it?
user20955's user avatar
  • 2,622

1
3 4 5 6
7