Answers for "python return contents of file"

2

python get file contents as string

with open('data.txt', 'r') as file:
    data = file.read().replace('n', '')
Posted by: Guest on August-06-2021
1

how to get the contents of a txt file in python

path= #path here
with open(path) as file
	contents = file.read()
Posted by: Guest on March-21-2021

Code answers related to "python return contents of file"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language