文件打开
1 contents = open("file_name.txt","rb").read().decode("gbk").encode("utf8")
1 def open_dict(Dict, path): 2 paths = os.path.join(path,Dict) 3 dictionary = open(paths,"rb").read().decode("utf8") 4 return(dictionary.split("\n"))
原文:http://www.cnblogs.com/250apples/p/7745900.html