4

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.

0

1 Answer 1

8

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, writing isinstance(f, file)).

In Python 3.x, file is no longer available.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.