Answers for "free function in python"

0

free function in python

PyObject *res;
char *buf = (char *) malloc(BUFSIZ); /* for I/O */

if (buf == NULL)
    return PyErr_NoMemory();
...Do some I/O operation involving buf...
res = PyBytes_FromString(buf);
free(buf); /* malloc'ed */
return res;
Posted by: Guest on June-17-2020

Python Answers by Framework

Browse Popular Code Answers by Language