Getting a dictionnary from a module's variables

ast nomail at com.invalid
Fri Jul 28 09:10:58 EDT 2017


"ast" <nomail at com.invalid> a écrit dans le message de news:597b31fb$0$4823$426a34cc at news.free.fr...

I answer to myself

import config
dico = {k:v for k, v in vars(conf).items() if not (k.startswith('__') or k.endswith('__'))}

that's not so difficult 




More information about the Python-list mailing list