Questions tagged [python-bindings]

86 questions
3
votes
1 answer

Using cppyy with rvalue pointers and maps

I would love to love cppyy. However the codebase I am using has heavy use of std.unique_ptr, rvalue pointers, and templates. I am confused about how to translate these into something I can call from python. For instance, I am stuck on how to create…
shouriha
  • 79
  • 6
3
votes
4 answers

Repeating single movie using Python bindings for VLC: what is a psz_name

I'm trying to write an little application that dynamically plays a single movie file repeatedly. I wrote it in Python, using these VLC-Python bindings I would say that this wouldn't be so hard and even though the very sparse documentation I can get…
Gilles
  • 343
  • 1
  • 4
  • 12
3
votes
0 answers

Approach to multi-threaded, multi-processing, async python embedded in c++ with PyBind

I wanted to do a stack inquiry before I do a deep dive tomorrow and start trying out every option under the sun. We have an application that we've embedded python inside with PyBind 11. In the current implementation application events are triggering…
Jeef
  • 26,861
  • 21
  • 78
  • 156
3
votes
3 answers

Cannot convert ‘char**’ to ‘wchar_t**’

The code excerpt: int main(int argc, char *argv[]){ PySys_SetArgv(argc, argv); produces error message error: cannot convert ‘char**’ to ‘wchar_t**’ for argument ‘2’ to ‘void PySys_SetArgv(int, wchar_t**)’ How do I convert argv?
user1561108
  • 2,666
  • 9
  • 44
  • 69
3
votes
3 answers

Python: variable bindings in recursive functions

I came across some weirdness in Python using a function similar to the following: def foo(x): if int(x)!=4: x = raw_input("Wrong guess, please enter new value: " ) foo(x) else: print "Good Job!…
arkansasred
  • 97
  • 1
  • 5
3
votes
1 answer

Are there available python bindinds for e2fsprogs/e2fslibs?

I have just started trying to automate the steps am trying to automate the steps listed in the Bad Blocks HOWTO for reallocating damaged sectors of a hard drive (after some unfortunate events). Unfortunately, the method that I have so far is to use…
rbrito
  • 2,398
  • 2
  • 21
  • 24
3
votes
1 answer

Protecting nose against Python interpreter crashes

We have a bunch of tests that call Python C/C++ bindings. We run these tests with nose: nosetests myapp ..... ---------------------------------------------------------------------- Ran 5 tests in 0.009s Sometimes, it happens that our bindings are…
André Anjos
  • 4,641
  • 2
  • 27
  • 34
2
votes
1 answer

Python Bindings with C++

I am interested in writing functions in C++ that can later be "imported" in Python. For example I wrote a simple function in C++ that adds two int numbers: //function declaration int addition(int a,int b); //function definition int addition(int…
IceCode
  • 177
  • 1
  • 13
2
votes
1 answer

What is the difference between python3.lib and python3x.lib In the Python installation libs folder?

I've been compiling a C library, and linking in the Python3 lib files for Python bindings. I've been using the python39.lib file as the link, but I was wondering what the difference is between the 'versioned' number (e.g. python3x.lib) vs the non…
ArcJamMcE
  • 95
  • 1
  • 1
  • 6
2
votes
0 answers

Debugging Segmentation fault. Help needed

Error on running code to debug using gdb: https://pastebin.ubuntu.com/p/PxrKVGmmTQ/ (gdb) run demo.py Starting program: /usr/bin/python3 demo.py [Thread debugging using libthread_db enabled] Using host libthread_db library…
2
votes
1 answer

Mapnik python bindings installation error

I've install mapnik by this tutorial https://github.com/mapnik/mapnik/wiki/WindowsInstallation . I think installation over succeed becouse test on 6. step have not errors. Next I procceed by this…
Denis Stephanov
  • 4,563
  • 24
  • 78
  • 174
2
votes
0 answers

cannot import xfeatures2d in python OpenCV binding

I am trying to access SIFT and SURF features from opencv 3 in python. As suggested by other people, I followed the installation of opencv_contrib. Some of the logs of the installation are: [ 82%] Built target opencv_xfeatures2d ... Installing:…
krips89
  • 1,683
  • 4
  • 17
  • 32
2
votes
0 answers

Is is possible to load profile extension in chromedriver session?

I develop a program, which checks browser plugin behaviour [ in python & selenium ]. The plugin is a black box to me I just have it installed in browsers. For example, in Firefox, i've installed it to my profile and force webdriver to open firefox…
dakov
  • 1,039
  • 2
  • 12
  • 33
2
votes
0 answers

Is it possible to write to/from python converts with Cython?

Is it possible to write to-python and from-python converters using Cython like it is possible for boost.python? Edit (on comment request, with more details on why we'd like this): We currently have code that is written in C++ that is bound to Python…
André Anjos
  • 4,641
  • 2
  • 27
  • 34
2
votes
1 answer

Python equivalent of DCT image hash function used in pHash module

I have an existing python program that accepts an image URL and does manipulations on the image loaded. I tried passing the image data to the pHash module in C++ and then get the image hash. I've tried using python extension library to pass the…
Shobhit Puri
  • 25,769
  • 11
  • 95
  • 124