![]() ![]() Is returned if the end of the file is reached immediately. If n is greater than 0, no more than n bytes will be readįrom the file a partial line can be returned. If n is 0, exactly one line is read, regardless of the length of p may be a file object or any object with a PyObject * PyFile_GetLine ( PyObject * p, int n ) ¶Įquivalent to p.readline(), this function reads one line from the Sets an exception and returns -1 on failure. Method must return an integer, which is returned as the file descriptor ![]() Object’s fileno() method is called if it exists the ![]() Object is an integer, its value is returned. Return the file descriptor associated with p as an int. Int PyObject_AsFileDescriptor ( PyObject * p ) ¶ Please refer to the io.open() function documentation.Ĭhanged in version 3.2: Ignore name attribute. For a more comprehensive description of the arguments, name is ignored and kept for backward compatibility. The arguments name, encoding, errors and newlineĬan be NULL to use the defaults buffering can be -1 to use theĭefault. Part of the Stable ABI.Ĭreate a Python file object from the file descriptor of an already PyObject * PyFile_FromFd (int fd, const char * name, const char * mode, int buffering, const char * encoding, const char * errors, const char * newline, int closefd ) ¶ The functions described below areĬonvenience C wrappers over these new APIs, and meant mostly for internalĮrror reporting in the interpreter third-party code is advised to access Io module, which defines several layers over the low-level unbuffered In Python 3, files and streams use the new Objects, which used to rely on the buffered I/O ( FILE *) supportįrom the C standard library. These APIs are a minimal emulation of the Python 2 C API for built-in file ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |