Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

open and read a file in python

my_file = open("C:UsersPythonfile.txt", "r")
#Give the path accurately and use 
text = my_file.read()
print(text)

#Output: The text in file.txt will be printed
 
PREVIOUS NEXT
Tagged: #open #read #file #python
ADD COMMENT
Topic
Name
8+4 =