python读取ini配置文件
当前位置:以往代写 > Python教程 >python读取ini配置文件
2019-06-14

python读取ini配置文件

python读取ini配置文件
python">#!/usr/bin/python
# -*- coding: iso-8859-1 -*-
import ConfigParser

# Open a configuration file
config = ConfigParser.SafeConfigParser()
config.read("config.ini")

# Read the whole configuration file
for section in config.sections():
    print "In section %s" % section
    for (key, value) in config.items(section):
        print "  Key %s has value %s" % (key, value)

标签:python

    关键字:

在线提交作业