Python-编写utf-8有符号整数



我正在尝试以.fits格式编写一个文件,据我所知,这需要utf编码,最好是utf-8。如何在utf-8中向文件中写入整数?

如何在utf8中为std-out:编码字符串

myString = "string"
string.encode('utf8')

Jon Skeet关于如何使用utf8:写入文件的python帖子

import codecs
file = codecs.open("lol", "w", "utf-8")
file.write(u'ufeff')
file.close()

最新更新