• 编码


    1.支持中文

    # coding:UTF-8
    import codecs    #默认文件读写编码为ASCII
    
    # f=open('a.txt',"w")
    # f.write("hello wrold")
    # f.close()
    
    content=u"我的世界aaa"
    f=codecs.open('a.txt','w',"utf-8")   #设置文件编码
    f.write(content)
    f.close();
  • 相关阅读:
    spark
    mongdb
    redis
    mysql
    kylin
    kafka
    hadoop+hive+hbase+kylin
    git
    elasticsearch
    clickhouse
  • 原文地址:https://www.cnblogs.com/zhuxiang1633/p/8848909.html
Copyright © 2020-2023  润新知