Outils pour utilisateurs

Outils du site


python:fichiers_ini

Fichiers INI

import configparser
 
config = configparser.ConfigParser()
config.read('FILE.INI')
print(config['DEFAULT']['path'])     # -> "/path/name/"
config['DEFAULT']['path'] = '/var/shared/'    # update
config['DEFAULT']['default_message'] = 'Hey! help me!!'   # create
 
with open('FILE.INI', 'w') as configfile:    # save
    config.write(configfile)
python/fichiers_ini.txt · Dernière modification: 2024/02/16 14:58 par marclebrun