Os.open vs open what to use

I am new to python and, looking at the docs, I saw that there are at least two ways to open 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 ?

+4
source share
1 answer

This is stated in the os.open documentation :

Note: This function is for low-level input / output. For normal use, use the built-in open () function, which returns a file object with the read () and write () methods (and many others). To wrap a file descriptor in a file object, use fdopen ().

+6
source

Source: https://habr.com/ru/post/1485670/


All Articles