#
#
# .2020-05-08 11:24:02
Python
# ., 2020-05-08 11:24:02

How to display the contents of a text file in Python?

There is a text.txt file, how to display the contents of the file?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
zexer, 2020-05-08
@andro1

with open('text.txt', 'r') as file:
    read_file = file.read()
print(read_file)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question