打开文件
file = open("文件名",'r',encoding = "utf-8")
#'r'只读模式,'w'写的模式(覆盖原文件),'a'追加模式;encoding指定编码集,系统默认为gbk,不支持中文
读取文件内容
file.read( )
with语法打开文件,防止文件忘记关闭的后果
with open("文件名","r",ecoding = "utf-8") as file1 \
open("文件名","r",ecoding = "utf-8") as file2:
......