Francesco Bochicchio wrote: > Python file objects have a method fileno() whic returns the 'C file > descriptor', i.e. the number used by low level IO in python as well as > in C. > I would use this as interface between python and C and then in the C > function using fdopen to get a FILE * for an already open file for > which you have a file descriptor. But note that this will be a *new* stdio file buffer attached to the same file descriptor, not the same one that the Python file object is using. This may or may not be a problem depending on what you're trying to do. If you need the same FILE * that Python is using, you may need to use ctypes to extract it out of the file object. -- Greg
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4