Reputation: 2185
I am working on file operation in python, i found two module, What is difference between the two file operation module "open" and "file" functionality wise i found both same.
thanks.
Upvotes: 4
Views: 407
Reputation: 500713
Python 2.x documentation says it all:
When opening a file, it’s preferable to use
open()
instead of invoking this constructor [file()
] directly.file
is more suited to type testing (for example, writingisinstance(f, file)
).
In Python 3.x, file
is no longer available.
Upvotes: 8