Questions tagged [extension-modules]

29 questions
1
vote
0 answers

Creating a metaclass in Cython

I aim to create a metaclass (let's call it SlotsMeta) in Cython that performs the following: It takes all the class variables defined by the class that uses the SlotsMeta as metaclass and converts them into readonly attributes in Cython. I am…
Jim
  • 450
  • 2
  • 10
1
vote
0 answers

Skbuild setuptools : put library in correct place

I implemented python bindings for a C++ project. I want the extension module to be installable via pip. I managed to get a setupfile working, that compiles the module : https://gitlab.com/cytosim/cytosim/-/tree/pybind So I can python3 setup.py sdist…
1
vote
1 answer

How to pip install extension modules in Azure web jobs?

I'm trying to schedule a python script that uses an extension module in an Azure web job: import sys sitepackage = "D:\home\site\wwwroot\env\Lib\site-packages" sys.path.append(sitepackage) try: from bs4 import BeautifulSoup print("!!!…
1
vote
0 answers

Minimalistic Python extension module providing a function sorting a list using Python sorted()

I am currently working on a C++ Python extension module and want to use in this module Pythons own standard library functions for performing operations on to the extension module passed objects. Down to an simple example I would like to know how to…
Claudio
  • 7,474
  • 3
  • 18
  • 48
1
vote
0 answers

Can't see my extension in Module List after copying it in root folder in opencart

i have copied the files of the extension in the root folder of the wesite (working on the localhost) but it doesn't show in the module list when i open the module list in the backend. Can somebody help me.
Deepak
  • 185
  • 2
  • 9
1
vote
1 answer

Creating Instance of Python Extension Type in C

I am writing a simple Vector implementation as a Python extension module in C that looks mostly like this: typedef struct { PyObject_HEAD double x; double y; } Vector; static PyTypeObject Vector_Type = { ... }; It is very simple to…
Brad Zeis
  • 10,085
  • 5
  • 26
  • 20
0
votes
0 answers

Using setuptools to build swig-generated extension module with out-of-tree sources

I try to transition from automake/autoconf instructions to setuptools and setup.py to build a swig-generated Python wrapper for a C-library. I already found many instructions how that can be accomplished, but all of them have the setup.py script in…
RaumZeit
  • 1
  • 2
0
votes
1 answer

Python: Best way to get shared object library path from within a pypi package

I'm developing a Python package that includes an extension module: # setup.py from distutils.core import setup, Extension setup( name="myPythonPkg", # ... all other args packages=["myPythonPkg"], ext_modules=[ …
Doron Behar
  • 2,606
  • 2
  • 21
  • 24
0
votes
1 answer

Python extension module with callbacks into Python

I am running into unpredictable behavior with my Python extension module that wraps around a C++ library that starts a new pthread and, after doing some work, generates callbacks back into the caller. I've greatly simplified this to a simplistic…
Paul Grinberg
  • 1,184
  • 14
  • 37
0
votes
1 answer

Running Cython install generates unwanted files

I am currently creating a python library for my python projects, and I require certain things to run much faster than normal python can, and Cython is the only way I can think to do this. I have created a setup.py file and have tried multiple…
Pencilcaseman
  • 360
  • 6
  • 16
0
votes
1 answer

dlltool fails with python27.def file

I want to create the libpython27.a from python27.dll (C:Windows/SysWOW64) I linux: /usr/i686-w64-mingw32/bin/dlltool -A --dllname python27.dll --def python27.def --output-lib libpython27.a /usr/i686-w64-mingw32/bin/dlltool: Syntax error in def file…
pablomtz
  • 129
  • 7
0
votes
1 answer

Extension modules: marshalling void * to bytearray (and/or vice versa)

Doing some experiments using python (means python3) for preparing data (also as sending them to wire - SPI) shows it is slow (having limited system). So I was thinking of creation of extension module written in C to defer the critical stuff to. I…
sharpener
  • 1,383
  • 11
  • 22
0
votes
2 answers

VTiger Extension Module create custom field for Accounts Module

I'm working on a VTiger 6.4.0 Extension Module that is used to get company data when entering a company name in the Accounts module. The module is almost finished, i retrieve data from a API and enter them in the input fields using JQuery. But the…
Lennart
  • 639
  • 4
  • 14
-3
votes
1 answer

What is the equivalent of "if item in list/set' in C code of a Python extension module?

Writing a Python extension module which is intended to speed up execution of a function written as Python script I am stuck with the problem of how to check in C-code of a Python extension module if a C-Python object is in a C-Python set/list of…
Claudio
  • 7,474
  • 3
  • 18
  • 48
1
2