Skip to content
Advertisement

Tag: c++

Syntax error calling Python from C with fork-execv

I want to call a Python script as a child process from a C program using fork and execv. I have tested it calling bin/ls and it works: So I changed the C code to call the Create_Buffer() function in this Python file: The Python script has two functions; I want to call Create_Buffer(), so I changed my C file

Interpret Python bytecode in C# (with fine control)

For a project idea of mine, I have the following need, which is quite precise: I would like to be able to execute Python code (pre-compiled before hand if necessary) on a per-bytecode-instruction basis. I also need to access what’s inside the Python VM (frame stack, data stacks, etc.). Ideally, I would also like to remove a lot of Python

How to kill C pthreads created by python ctypes.LoadLibrary

The module I’m using loads C library via ctypes.LoadLibrary in __init__ and calls a function which creates two processes using pthread_create C api. Thread IDs are not stored anywhere. These processes contain while(1) loops that read and write to serial port. I want to be able to kill the library threads, use said serial port for other purposes and then

How to draw multi-color segmented circle using OpenCV?

What is the best way to draw multi-color segmented circle using OpenCV like below? What I found, it can be: Using cv.fillPoly Many points are required for an arcs accurate drawing, the number of segments is several hundred; Using cv.line by rotating the line in a circle; Using cv.line by rotating whole image like in this similar case. Answer Using

Install conan package without requirements?

Is there a possibility to install a conan package without requirements? I build a metapackage, which only contains some configurations and depends on other binary packages in the requires section. Now I want to access only the configurations w/out downloading all dependencies, Is there a possibility to do so? conan download downloads a package, but won’t install it, e.g. there

mask and apply numpy where function to a vector in c++

I’m using C++ and want to combine the masking of a vector and the search for the indexes where a condition is verified, similarly to the numpy where function. Here’s an example: After using masked should look like this: masked = {62, 62, 70, 65} Afterwards, I want to find the indexes where id vector elements are greater than masked

Advertisement