# 在b模式只能写入字节 with open(r"D:\sh_fullstack_s6\day8\代码\test.txt",mode="wb") as f: f.write("abc".encode("utf-8")) #写的时候需要自己指定编码表 f.write("你y好".encode("utf-8"))
posted on 2019-02-06 22:51 小胖子方法 阅读(111) 评论(0) 收藏 举报