Python Basics-Day 5 learning note-Standard library of modules: Configparser (10)

Source: Internet
Author: User
Tags configuration settings

Configparser Module Introduction

Used to generate and modify common configuration documents (config file).

Configuration file format

A user profile is a collection of settings and files for the user to load the desired environment when the user logs on to the computer or when the user is using the software. It includes all user-specific configuration settings, such as program items, screen colors , Network Connections , printer connections, mouse settings, and window size and location. The general format includes Ini,cfg,xml, config and so on. The format of the configuration file is as follows

[DEFAULT] Serveraliveinterval = 45Compression = Yescompressionlevel = 9forwardx11 = yes [Bitbucket.org]user = HG [topsecret.server.c Om]port = 50022forwardx11 = no

Or

# A simple example with comments. [Bug_tracker]url = Http://localhost:8080/bugs/username = Dhellmann; You should not store passwords in plain text; Configuration Files.password = SECRET
Common operations

Build configuration file

Python Basics-Day 5 learning note-Standard library of modules: Configparser (10)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.