Re: [Tutor] Questions about the formatting of docstrings

2018-07-27 Thread boB Stepp
On Fri, Jul 27, 2018 at 12:50 AM Steven D'Aprano wrote: > > On Thu, Jul 26, 2018 at 11:34:11PM -0500, boB Stepp wrote: > > (1) The author claims that reStructuredText is the official Python > > documentation standard. Is this true? If yes, is this something I > > should be doing for my own proj

Re: [Tutor] Questions about the formatting of docstrings

2018-07-27 Thread Mats Wichmann
On 07/27/2018 11:23 AM, boB Stepp wrote: > On Fri, Jul 27, 2018 at 12:50 AM Steven D'Aprano wrote: >> >> On Thu, Jul 26, 2018 at 11:34:11PM -0500, boB Stepp wrote: > >>> (1) The author claims that reStructuredText is the official Python >>> documentation standard. Is this true? If yes, is this

Re: [Tutor] how to change the command "string" on a tkinter Button?

2018-07-27 Thread Shall, Sydney
On 01/07/2018 11:19, Steven D'Aprano wrote: On Sun, Jul 01, 2018 at 03:32:59PM +1000, Chris Roy-Smith wrote: "Save As..." before engaging in big changes is your friend :-) Even better would be to learn a form of VCS (version control system) such as Mercurial (hg) or git. Depending on the te

[Tutor] Do something on list elements

2018-07-27 Thread Valerio Pachera
Hi all, I started studying python and I hope you may help me getting better. Let's start with the first question. Consider this example --- #!/usr/bin/python3 l = ['unoX', 'dueX'] c = 0 for n in l: l[c] = l[c].replace('X','') c = c + 1 print (l) --- it works but I wonder if ther

Re: [Tutor] how to change the command "string" on a tkinter Button?

2018-07-27 Thread Alan Gauld via Tutor
On 27/07/18 11:55, Shall, Sydney wrote: > On 01/07/2018 11:19, Steven D'Aprano wrote: >> Even better would be to learn a form of VCS (version control system) >> such as Mercurial (hg) or git. Depending on the text editor you are >> using, it may have VCS integration available. > > Does Spyder have

Re: [Tutor] Do something on list elements

2018-07-27 Thread Alan Gauld via Tutor
On 27/07/18 13:56, Valerio Pachera wrote: > l = ['unoX', 'dueX'] > c = 0 > for n in l: > l[c] = l[c].replace('X','') > c = c + 1 > print (l) > --- > > it works but I wonder if there's a better way to achieve the same. Yes, a much better way. for index, s in l: l[index] = s.re

Re: [Tutor] Do something on list elements

2018-07-27 Thread Cameron Simpson
On 27Jul2018 23:06, Alan Gauld wrote: On 27/07/18 13:56, Valerio Pachera wrote: l = ['unoX', 'dueX'] c = 0 for n in l: l[c] = l[c].replace('X','') c = c + 1 print (l) it works but I wonder if there's a better way to achieve the same. Yes, a much better way. for index, s in

Re: [Tutor] Do something on list elements

2018-07-27 Thread Alan Gauld via Tutor
On 27/07/18 23:32, Cameron Simpson wrote: >> for index, s in l: >> l[index] = s.replace('X','') >> print(l) > > I think you meant: > > for index, s in enumerate(l): Oops, yes. Sorry. >> In Python you very rarely need to resort to using indexes >> to process the members of a collection. And

Re: [Tutor] Do something on list elements

2018-07-27 Thread Mats Wichmann
On 07/27/2018 04:32 PM, Cameron Simpson wrote: > On 27Jul2018 23:06, Alan Gauld wrote: >> In Python you very rarely need to resort to using indexes >> to process the members of a collection. And even more rarely >> do you need to manually increment the index. I think this was an important point: