I’ve found this thread on StackOverflow but my python understanding isn’t that good to properly translate it to C, I’m trying to add that gradient feature to this line drawing algorithm: I feel bad for asking such a trivial task but I really can’t understand what is going on on the python side nor how the colours are represented (mine
Tag: c++
Get image from a fingerprint using Python and Ctypes
I’m trying to get an image from the fingerprint scanner Futronic FS88h, here is what I’ve been doing until now. With this I’m able to check if the finger is present and it actually retrieves some info, but I need to get the image from the device and I’m not quite sure how to do it, I’ve been trying this:
Calling C++ function which accepts and returns std::string from Python
I’m trying to call C++ function using ctypes. The function declaration looks like As Python can not interact with C++ directly, I have created a C-wrapper for this function as follows And Python wrapper But when I try to call Python wrapper with some bytes passed as param, for example It fails with the following error I’m not very good
parameter difference between C++ and Python
C++ Python I think their code should return same result however C ++ result is Python result is i don’t understand why variable’s address isn’t changed in Python while variable’s address is changed in C++ Answer i don’t understand why variable’s address isn’t changed in Python while variable’s address is changed in C++. Because in python, we pass an object
Sending a request with Windows Authentication from ASP.NET service
I have a working Python script which sends a request to an web service using Windows Authentication in order to get a token. The bit that I’m trying to replicate is: I have an ASP.NET Core service which tries to do it this way: Right now I am getting the following error: WinHttpException: Error 12029 calling WINHTTP_CALLBACK_STATUS_REQUEST_ERROR, ‘A connection with
Why the location of python list is not being changed if the size is increased?
As far as I know, python list is a dynamic array. So when we reach a certain size, the capacity of that list will be increased automatically. But the problem is, unlike dynamic array of c or c++, even after increasing the capacity of list instance, the location is not being changed. Why is it happening? I’ve tested this using
Why is C++ getline() non-blocking when program is called from python subprocess?
I have a C++ program that waits for some text input with getline(), and it works well from the command line. However, I would like to call it from Python – send some text, get the output, and have it wait for more input. I tried with subprocess, but it seems that getline() in this case doesn’t wait for input
Different results when running C program from Python Subprocess vs in Bash
I’ve got a string/argument that I’d like to pass to a C program. It’s a string format exploit. However, there seems to be different behaviours exhibited if I call the C program from Python by doing versus The difference is that the string exploit attack works as expected when calling the script via subprocess, but not when I call it
How to manage an object from a class defined in python using the C-Python API
I have two versions of a part of a program. One is written in C and the second one is in Python. The Python version has been developed much more than the C version but a critical function is slow and is already present in C. Therefore I want to wrap the C-version using the C-Python API and import it
c++ equivalent to python self.attribute = ObjectInstance()
i want to know if there is an equivalent way of doing this in c++: Answer self.b in C++ could be this->b, but also just b as this is implicit in C++. However, in C++, you have to declare (member) variables, while in Python you create them by assigning to them and the type of the variable is determinated by