Answers for "Read the entire text file using the read() function"

0

Read the entire text file using the read() function

# Program to read the entire file using read() function
file = open("python.txt", "r")
content = file.read()
print(content)
file.close()


# Program to read the entire file (absolute path) using read() function
file = open("C:/Projects/Tryouts/python.txt", "r")
content = file.read()
print(content)
file.close()
Posted by: Guest on September-25-2021

Code answers related to "Read the entire text file using the read() function"

Python Answers by Framework

Browse Popular Code Answers by Language