Avatar ·

Calling C++ function from Python

📁 python, ии

There is a Python script that has a path to a file, it is necessary to open this file in a C/C++ function, perform manipulations with it and return the result to the Python script.

I read: , but still didn't understand how to do it.

Avatar ·

Your PC has a problem with the root certificate chain. As a temporary workaround, you can disable certificate validation by adding the following to your code:

import sslssl._create_default_https_context = ssl._create_unverified_context

or specify verify = False in the request itself:

requests.get(url, verify=False)

To fix the problem properly, you need to either update the certificates. You can find the path to their location using:

import sslprint(ssl.get_default_verify_paths().openssl_cafile) 

or use certificates that come with libraries, such as certifi.

Log in to leave an answer

Интересные статьи