How to read the content of a text file in Python

1 Answer

0 votes
f = open("d:\data.txt", "rt")  # OR f = open("d:\data.txt")

print(f.read())


'''
run:
 
C++
VB.NET
C#
Java
PHP
Python

'''

 



answered Nov 26, 2018 by avibootz

Related questions

2 answers 347 views
1 answer 175 views
175 views asked Jul 8, 2020 by avibootz
1 answer 183 views
2 answers 285 views
1 answer 187 views
2 answers 225 views
...