Questions tagged [python-extensions]

Python is an interpreted, general-purpose high-level programming language whose design philosophy emphasizes code readability.

323 questions
1
vote
0 answers

SWIG C++ to Python: typemaps and methods accepting pointers to primitive type

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 explained in the SWIG documentation here so that…
Homunculus Reticulli
  • 65,167
  • 81
  • 216
  • 341
1
vote
1 answer

How to create separate files with dependencies for Cython and how to fix compilation error: Cannot convert Python object to 'mySet*'

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, which then depends on module A. I am finding it…
Homunculus Reticulli
  • 65,167
  • 81
  • 216
  • 341
1
vote
1 answer

Get notification in a VS Code extension when the Python interpreter is changed

I am writing a VS Code extension that depends on the currently set Python interpreter. When I change the Python Interpreter via the VS Code UI, the extension needs to refresh and get the latest Python path (mainly to show the right environment…
1
vote
1 answer

How does VSCode's Python Extension handle a missing .env file?

I'm trying to troubleshoot an issue with VSCode's Python extension loading the wrong version of Python and I'd like to rule out incorrect environment variables being an issue. In the Python Extension's settings there is the following option: My…
Connor
  • 867
  • 7
  • 18
1
vote
0 answers

Read all fundus images from a folder and detect ONH, crop, and save to new folder

I have fundus images, need to crop ONH from the images and save it in the other folder. Can anybody help me out? IT will be great if I get the python code for the same. Cheers,A
1
vote
1 answer

Kinesis WebRTC C SDK - Convert Frames to Images

I managed to wrap kvsWebRTCClientViewer in a python C extension and I also managed to expose frame data to python via callback function as bytes array but I don't understand how to convert these frames to images. Does it require gstreamer…
1
vote
1 answer

How to modernize code that uses deprecated NumPy C API?

The following C or C++ code, intended for use in a Python extension module, defines a function f that returns a NumPy array. #include #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION #include PyObject* f() { …
Joachim W
  • 7,290
  • 5
  • 31
  • 59
1
vote
0 answers

Programmatically obtain Python install paths in prefix, without distutils

As distutils is being removed from Python in the > 3.10 versions, and setuptools will not be added to the stdlib, I want to replace an existing setup.py recipe for building/installing a C++ library Cython extension (i.e. not primarily a Python…
1
vote
0 answers

Linker error despite symbols located in linked library

I am having difficulty importing a python extension module that depends on a separate shared library that I am building via a separate build system. When I attempt to import the module, I get an undefined symbol error: import ext_mod …
1
vote
0 answers

azure python extension fail on 'conflict' in deployment ARM

I am using template for azure web app . net deployment. I need python extension to deploy as well after MSbuild is deployed. This script works when resource group and app service plan is new, but it fails when there are already web apps running on…
moeen-ud-Din
  • 160
  • 1
  • 13
1
vote
1 answer

How to release GIL after Py_Initialize?

I am trying to embed python in a GUI application, and so I have a the python interpreter initialized in the main thread of the application, and I may launch python scripts from another one. I read about PyGILState_Ensure and PyGILState_Release, and…
arthropode
  • 1,361
  • 2
  • 12
  • 19
1
vote
1 answer

Interfacing a cpython extension with a C struct

I am trying to create a python extension to interface python with my C software. Mainly I need to made a big struct from C software accessible and modifiable in python, so I would like to create a Python class to do the intermediate, eg so that…
arthropode
  • 1,361
  • 2
  • 12
  • 19
1
vote
0 answers

Testing a vscode extension that depends on another one

I'm trying to write a test for an extension. The extension uses the python extension (ms-python.python). Therefore I put this in my package.json: "extensionDependencies": [ "ms-python.python" ], To be able to run my test I need…
1
vote
1 answer

Sorting imports fails on Python VSCode extension

Background I have an anaconda environment that has Python 3.7 installed. I have a file with some imports out of order which I want VScode to order when pressing CRTL+s. However, instead or ordering the imports, there is a crash and nothing…
Flame_Phoenix
  • 16,489
  • 37
  • 131
  • 266
1
vote
0 answers

f2py convert subroutine with argument has intent of inout

Through f2py -c sorting.f90 -m sortF, I get sortF.cpython-37m-x86_64-linux-gnu.so which is great. sorting.f90 module sorting use iso_fortran_env, only: i4 => int32, i8 => int64 implicit none contains subroutine bubbleSort(array) …
ComplicatedPhenomenon
  • 4,055
  • 2
  • 18
  • 45