Answers for "how to read a whole text file in ython"

29

get text from txt file python

with open ("data.txt", "r") as myfile:
    data = myfile.read().splitlines()
Posted by: Guest on December-10-2020
0

read all text file python

# Open a file: file
file = open('my_text_file',mode='r')
 
# read all lines at once
all_of_it = file.read()
 
# close the file
file.close()
Posted by: Guest on September-04-2021

Code answers related to "how to read a whole text file in ython"

Python Answers by Framework

Browse Popular Code Answers by Language