0

Considering there exists a manually user created text file named "roger.txt" and it contains "Tennis Roger Federer Armin" as its contents. Pickle can't open manually created files. Which packages can open manually created files in python so that when I run the code, I get the output as 'Tennis Roger Federer Armin'?

2 Answers 2

7

Why do you need a package? Just read the file:

with open('roger.txt', 'r') as handle:
    print handle.read()
Sign up to request clarification or add additional context in comments.

Comments

1

Or in one line, wthout the context guard and optional file mode....

print open('roger.txt').read()

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.