网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

configparser.ConfigParser.writer()

    ①
    write(fileobject, space_around_delimiters=True)

Write a representation of the configuration to the specified file object,which must be opened in text mode(accepting strings),This representation can ba parsed by a future read() call.if space_around_delimiters is true,delimiters between keys an values are surrounded by spaces.

创新互联专注于象山企业网站建设,成都响应式网站建设公司,成都商城网站开发。象山网站建设公司,为象山等地区提供建站服务。全流程定制网站,专业设计,全程项目跟踪,创新互联专业和态度为您提供的服务

config = configparser.Configparser()
must be opened in text mode (accept strings):只能使用text模式打开的文件才能被写入,with open('users.pkl', 'w') as f:
config.writer(f)

②
read(filenames, encoding=None)
            If filenames is a string or path-like object, it is treated as a single filename. If a file named in filenames cannot be opened, that file will be ignored. This is designed so that you can specify a list of potential configuration file locations (for example, the current directory, the user’s home directory, and some system-wide directory), and all existing configuration files in the list will be read.

If none of the named files exist, the ConfigParser instance will contain an empty dataset. An application which requires initial values to be loaded from a file should load the required file or files using read_file() before calling read() for any optional files:

    import configparser, os

config = configparser.ConfigParser()
config.read_file(open('defaults.cfg'))


文章题目:configparser.ConfigParser.writer()
路径分享:http://bjjierui.cn/article/gjhjdh.html

其他资讯