I'm new to python and, looking at the docs, saw that there are at least two ways of opening a file for access os.open
and open
. What is the difference between os.open
and open
?
When should I use os.open
?
When should I use open
?
It is mentioned in the documentation of os.open
:
Note: This function is intended for low-level I/O. For normal usage, use the built-in function open(), which returns a file object with read() and write() methods (and many more). To wrap a file descriptor in a file object, use fdopen().
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With