Re: Use global, or not

2019-06-29 Thread Michael Torrie
On 06/29/2019 05:42 AM, Cecil Westerhof wrote: > That was the other possibility I was thinking about. And that would be > maybe better. Because I now do things like: > global_dict['messages']['created'].format(len(filepathArr)) > > much better would be: > instance.created(len(filepathArr))

Re: Use global, or not

2019-06-29 Thread DL Neil
On 29/06/19 11:42 PM, Cecil Westerhof wrote: DL Neil writes: On 29/06/19 1:44 AM, Cecil Westerhof wrote: I have written a GUI program where I have quit a few global variables. I did not like this, so I now use one global dict. Something like: global global_dict ... Is that an acceptab

Re: Use global, or not

2019-06-29 Thread Cecil Westerhof
DL Neil writes: > On 29/06/19 1:44 AM, Cecil Westerhof wrote: >> I have written a GUI program where I have quit a few global variables. >> I did not like this, so I now use one global dict. Something like: >> global global_dict > ... > >> Is that an acceptable way to do this? > > > If it wor

Re: Use global, or not

2019-06-28 Thread DL Neil
On 29/06/19 1:44 AM, Cecil Westerhof wrote: I have written a GUI program where I have quit a few global variables. I did not like this, so I now use one global dict. Something like: global global_dict ... Is that an acceptable way to do this? If it works, isn't that the largest part of

Use global, or not

2019-06-28 Thread Cecil Westerhof
I have written a GUI program where I have quit a few global variables. I did not like this, so I now use one global dict. Something like: global global_dict canceled_report = 'Genereren rapportage gecanceled.' created_report = 'Rapportage voor {} bestanden is gemaakt.' e

Re: Use global, or not

2019-06-28 Thread Rob Gaddi
On 6/28/19 6:44 AM, Cecil Westerhof wrote: I have written a GUI program where I have quit a few global variables. I did not like this, so I now use one global dict. Something like: [snip] global_dict = { 'messages': messages, 'progress': progress, 'windo