configparser

suggest change

Syntax

Remarks

Creating configuration file programmatically

The output file contains the structure below. The code that writes it is not shown.

[settings]
resolution = 320x240
color = blue

If you want to change a particular field, get the field and assign the value. config is not defined in this fragment.

settings=config['settings']
settings['color']='red'

Basic usage

In config.ini:

[DEFAULT]
debug = True
name = Test
password = password

[FILES]
path = /path/to/file

In Python:

The Python that reads this file is not shown.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents