Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

read text file in python

file = '/home/text/chapter001.txt'
f=open(file,'r')
data = f.read()
print('data =',data)
Source by www.pythontutorial.net #
 
PREVIOUS NEXT
Tagged: #read #text #file #python
ADD COMMENT
Topic
Name
3+7 =