dimanche 13 septembre 2020

Is it possible to use ConfigParser to get random value

I want to get a random value from .ini file in the range of 14, 55. I know I'm doing it wrong but what is the right way?

import random
import configparser

IN_settings = configparser.ConfigParser()
IN_settings.read('config.ini')

print(IN_settings['common'].getint((random.randint('out_put')))

and this is my config file:

[common]
out_put = 14, 55



Aucun commentaire:

Enregistrer un commentaire