Difference between python open file files and file.

I am working on a file operation in python, I found two modules, What is the difference between the two file operating modules "open" and "file" functionality wise I found both.

thanks.

+4
source share
1 answer

The Python 2.x documentation says it all :

When opening a file, it is preferable to use open() instead of calling this constructor [ file() ] directly. file more suitable for type testing (for example, the notation isinstance(f, file) ).

In Python 3.x, file no longer available.

+8
source

All Articles