# -*- coding: utf-8 -*-
file =open('/Users/april_chou/Desktop/WorkSpace/Selenium/seleniumTest/test.txt','r')
context = file.read()
print('read格式:')
print(context)
file.close()
print()
file =open('/Users/april_chou/Desktop/WorkSpace/Selenium/seleniumTest/test.txt','r')
context = file.readlines()
contextLines =''
for i in context:
contextLines = contextLines + i
print('readlines格式:')
print(contextLines)
file.close()
print()
file =open('/Users/april_chou/Desktop/WorkSpace/Selenium/seleniumTest/test.txt','r')
contextLines =''
while True:
context = file.readline()
contextLines = contextLines + context
if len(context) ==0:
break
print('readline格式:')
print(contextLines)
file.close()