I am working on a Python extension module in C++ and I have a FILE
object and I want to propagate it Python code so I can work in some way (reading, writing, etc). In Python2 it was possible to use PyFile_FromFile
and create a Python object. Since this is deprecated in Python3, What is a best way now?
Asked
Active
Viewed 44 times
1

dohnto
- 584
- 5
- 13
-
like `object = open('myfile.txt', 'r')`? – Kamejoin Oct 26 '15 at 17:36
-
@Kamejoin, I should emphasized that I am writing a C++ (Python extension) module. – dohnto Oct 26 '15 at 17:39