424,066 Members | 2,121 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,066 IT Pros & Developers. It's quick & easy.

Print the contents of a file

P: 4
How can I print the contents of a file?
1 Week Ago #1
Share this Question
Share on Google+
1 Reply


P: 5
>>> try:
with open('tabs.txt','r') as f:
print(f.read())
except IOError:
print("File not found")

You can also refer this article for Python File i/o.
5 Days Ago #2

Post your reply

Sign in to post your reply or Sign up for a free account.