Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to read files in python

f = open("demofile.txt", "r")
print(f.read()) 
f.close()

#OR

with open("demofile.txt","r") as file:
  print(file.read())
 
PREVIOUS NEXT
Tagged: #read #files #python
ADD COMMENT
Topic
Name
4+1 =