Re: [Tutor] still breaking chains

2015-04-13 Thread Jim Mooney
On Apr 12, 2015 4:00 PM, "Jim Mooney" wrote: > > > > If join returns a string, why am I getting a syntax error when I try to > > slice it? > > > > >>> 'alfabeta'[2:5] > > 'fab' > > >>> ''.join(['a', 'l', 'f', 'a', 'b', 'e', 't', 'a')[2:5] > > SyntaxError: invalid syntax > > If you're seeing a Sy

Re: [Tutor] Please disable “digest” mode in order to participate

2015-04-13 Thread Jim Mooney
> That's an interesting feature. It's not sufficient though: the resulting > messages lack the full header of each message, so any reply will not be > properly marked as a response to the original. > > The only way to participate properly in a discussion on a mailing list > is to respond to the act

Re: [Tutor] still breaking chains

2015-04-13 Thread Jim Mooney
> Chaining long strings of operations together in a single statement goes > directly against that principle, and hence is to be avoided. > > Ben Finney > > A hard habit to break after using jQuery as a webmaster ;') -- Jim "Stop, Harold! That bagel has radishes!" "Thank God, Mary - you've saved m

Re: [Tutor] Please disable “digest” mode in order to participate

2015-04-13 Thread Ben Finney
Jim Mooney writes: > > The only way to participate properly in a discussion on a mailing > > list is to respond to the actual messages that were sent. And that's > > only possible if you disable “digest” mode beforehand. > > Well, I've disabled digest and assume I should Reply to All and underpos

Re: [Tutor] Please disable “digest” mode in order to participate

2015-04-13 Thread Alan Gauld
On 13/04/15 00:51, Jim Mooney wrote: The only way to participate properly in a discussion on a mailing list is to respond to the actual messages that were sent. And that's only possible if you disable “digest” mode beforehand. Well, I've disabled digest and assume I should Reply to All and und

[Tutor] Function not returning 05 as string

2015-04-13 Thread Ken G.
I am sure there is an simple explanation but when I input 5 (as integer), resulting in 05 (as string), I get zero as the end result. When running the code: START OF PROGRAM: Enter the 1st number: 5 05 0 END OF PROGRAM: START OF CODE: import sys def numberentry(): print number01 = raw

Re: [Tutor] Function not returning 05 as string

2015-04-13 Thread Dave Angel
On 04/13/2015 08:11 AM, Ken G. wrote: I am sure there is an simple explanation but when I input 5 (as integer), resulting in 05 (as string), I get zero as the end result. When running the code: START OF PROGRAM: Enter the 1st number: 5 05 0 END OF PROGRAM: START OF CODE: import sys def numb

[Tutor] Regular expression on python

2015-04-13 Thread jarod...@libero.it
Dear all. I would like to extract from some file some data. The line I'm interested is this: Input Read Pairs: 2127436 Both Surviving: 1795091 (84.38%) Forward Only Surviving: 17315 (0.81%) Reverse Only Surviving: 6413 (0.30%) Dropped: 308617 (14.51%) with open("255.trim.log","r") as p:

Re: [Tutor] Function not returning 05 as string

2015-04-13 Thread Ken G.
On 04/13/2015 08:18 AM, Dave Angel wrote: On 04/13/2015 08:11 AM, Ken G. wrote: I am sure there is an simple explanation but when I input 5 (as integer), resulting in 05 (as string), I get zero as the end result. When running the code: START OF PROGRAM: Enter the 1st number: 5 05 0 END OF

Re: [Tutor] Function not returning 05 as string

2015-04-13 Thread Peter Otten
Ken G. wrote: > I am sure there is an simple explanation but when I input > 5 (as integer), resulting in 05 (as string), I get zero as the end > result. When running the code: > > START OF PROGRAM: > Enter the 1st number: 5 > > 05 > > 0 > END OF PROGRAM: > > START OF CODE: > import sys > > d

Re: [Tutor] Function not returning 05 as string

2015-04-13 Thread David Palao
Hello, In the code that you posted, as it is, you are: 1) defining a function (numberentry) 2) defining a global variable (number01) and setting it to 0 3) calling numberentry discarding the result 4) printing the value of the global variable number01 I would guess that you want to store the resul

Re: [Tutor] Function not returning 05 as string

2015-04-13 Thread Steven D'Aprano
On Mon, Apr 13, 2015 at 08:11:46AM -0400, Ken G. wrote: > I am sure there is an simple explanation but when I input > 5 (as integer), resulting in 05 (as string), I get zero as the end > result. When running the code: > number01 = 0 Here you set the variable "number01" to the int 0. > numberentr

Re: [Tutor] Function not returning 05 as string [SOLVED]

2015-04-13 Thread Ken G.
On 04/13/2015 08:56 AM, Steven D'Aprano wrote: On Mon, Apr 13, 2015 at 08:11:46AM -0400, Ken G. wrote: I am sure there is an simple explanation but when I input 5 (as integer), resulting in 05 (as string), I get zero as the end result. When running the code: number01 = 0 Here you set the vari

[Tutor] R: Tutor Digest, Vol 134, Issue 36

2015-04-13 Thread jarod...@libero.it
At the moment I use this way to resolve my question: re.findall(r'(\w+):\W(\d+)',str(tp[0])) However please gave me you suggestion on how to improve my ability to use regular expression on python Thanks so much! ___ Tutor maillist - Tutor@python.o

Re: [Tutor] On learning Fortran and C++ for scientific computing

2015-04-13 Thread Vick
Hi, Thanks Vick -Original Message- From: Laura Creighton [mailto:l...@openend.se] Sent: Sunday, 12 April, 2015 15:30 To: Vick Cc: 'Laura Creighton'; 'William Ray Wing'; webmas...@python.org; tutor@python.org; l...@openend.se Subject: Re: [Tutor] On learning Fortran and C++ for

[Tutor] Python and Django Web Engineering Class

2015-04-13 Thread Chris Calloway
Not for everybody, but this just popped up in my neck of the woods, organized by members of my Python user group, and I though there might be a few people here looking for something like this: http://astrocodeschool.com/ It's one of those intensive multi-week code school formats that aren't i

Re: [Tutor] Please disable “digest” mode in order to participate

2015-04-13 Thread Laura Creighton
In a message of Sun, 12 Apr 2015 16:51:04 -0700, Jim Mooney writes: >Well, I've disabled digest and assume I should Reply to All and underpost. >How does that look? > >-- >Jim Looks great here. Laura ___ Tutor maillist - Tutor@python.org To unsubscr

Re: [Tutor] Regular expression on python

2015-04-13 Thread Alan Gauld
On 13/04/15 13:29, jarod...@libero.it wrote: Input Read Pairs: 2127436 Both Surviving: 1795091 (84.38%) Forward Only Surviving: 17315 (0.81%) Reverse Only Surviving: 6413 (0.30%) Dropped: 308617 (14.51%) Its not clear where the tabs are in this line. But if they are after the numbers, like s

Re: [Tutor] Regular expression on python

2015-04-13 Thread Alan Gauld
On 13/04/15 19:42, Alan Gauld wrote: if lines.startswith("Input"): tp = lines.split("\t") print re.findall("Input\d",str(tp)) Input is not followed by a number. You need a more powerful pattern. Which is why I recommend trying to solve it as far as possible w

Re: [Tutor] Regular expression on python

2015-04-13 Thread Steven D'Aprano
On Mon, Apr 13, 2015 at 02:29:07PM +0200, jarod...@libero.it wrote: > Dear all. > I would like to extract from some file some data. > The line I'm interested is this: > > Input Read Pairs: 2127436 Both Surviving: 1795091 (84.38%) Forward > Only Surviving: 17315 (0.81%) Reverse Only Surviving: 641