Unable to pass dict from json.

MRAB python at mrabarnett.plus.com
Sat Dec 12 19:54:09 EST 2020


On 2020-12-13 00:01, Bischoop wrote:
> 
> Here https://bpa.st/YBVA  I've working code with dictionary only if used dict from the code
> (it's commented now) but when I load it I can print it from load
> function (line 14)  but at all have not a
> clue how to pass the data so could use them.
> I've learnt a lot when making it but here I'm completetly stuck, was
> trying do solve it for a whole day and it's just a death wall for me.
> 
It would be better to use a loop instead of recursion in load_options 
when asking for the choice.

load_json returns the data, so just have load_options return it and then 
pass it in to the functions that need it.

There's no need to make 'load_json' and the others local to 
'load_from_file', and similarly for save_tofile.


More information about the Python-list mailing list