[Python] python写入带有中文字的字符串到文件 →→→→→进入此内容的聊天室

来自 , 2019-07-18, 写在 Python, 查看 114 次.
URL http://www.code666.cn/view/988f9153
  1. # -*- coding: utf-8 -*-
  2.  
  3. import codecs
  4. content = u'你好,脚本分享网 sharejs.com'
  5. f = codecs.open('c:/1.txt','w','utf-8')
  6. f.write(content)

回复 "python写入带有中文字的字符串到文件"

这儿你可以回复上面这条便签

captcha