The C API in Python 3.0 has changed (deprecated) many of the functions for File Objects.
Before, in 2.X, you could use
PyObject* PyFile_FromString(char *filename, char *mode)
to create a Python file object, e.g:
PyObject *myFile = PyFile_FromString("test.txt", "r");
…but such function no longer exists in Python 3.0.
What would be the Python 3.0 equivalent to such call?
You can do it the old(new?)-fashioned way, by just calling the io module.
This code works, but it does no error checking. See the docs for explanation.