open() 函数打开文件
helloFile = open('C:\\Users\\your_home_folder\\hello.txt')
read() 方法读取文件;返回文件中的字符串
readlines() # 方法取得一个字符串的列表。
>>> helloContent = helloFile.read()
>>> helloContent
'Hello world!'
写入文件
>>> baconFile = open('bacon.txt', 'w')
>>> baconFile.write('Hello world!\n')
13
>>> baconFile.close()