As the title suggests, I'd like to pass a byte array from c++ to python. I understand I would need to convert my byte array into a PyObject somehow but this is where I got stuck. Is there anyone who can help me out with this.
Thanks in advance,
PyBytes_FromString
to the rescue assuming Python3+:
https://docs.python.org/3/c-api/bytes.html
Under Python2.x PyString_FromString
:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.