Sto tentando di scrivere (e successivamente di leggere in) il contenuto di un dizionario in ConfigParser, e credo che lo stia facendo correttamente secondo lo docs, ma non riesco a ottenerlo lavoro. Qualcuno può aiutare?Python Write Dictionary Contents to ConfigParser
import ConfigParser
parser = ConfigParser.ConfigParser()
parser['User_Info'] = {"User1-votes":"36","User1-gamestart":"13232323","User2-votes":"36","User2-gamestart":"234234234","User3-votes":"36","User3-gamestart":"13232323"}
Traceback (most recent call last): File "<stdin>", line 1, in
<module> AttributeError: ConfigParser instance has no attribute '__setitem__'
Quello che sto cercando è quello di avere un dizionario che posso aggiornare, e alla fine in scrittura a un file di configurazione in modo che sarebbe simile:
[User_Info]
User1-gamestart = 13232323
User3-votes = 36
User2-votes = 36
User1-votes = 36
User2-gamestart = 234234234
User3-gamestart = 13232323
Il modulo ConfigParser non è lo stesso di ConfigParser. Quel documento è per Python 3.4, quale versione di Python stai usando? – cmd