在写入文件的时候在window上可能会出现乱码,改进方法是:在打开文件的时候设置如utf-8编码即可。
if title is not None: self.file = open(title+".txt","w+",encoding='utf-8') else: self.file = open(self.defaultTitle+".txt","w+",encoding='utf-8')