Re: unexplainable python

2009-09-27 Thread Terry Reedy
dads wrote: Thank you for the help, it's amazing what you can't spot. It seems the harder you look the less likely you're to find the issue. Fresh eyes make the world of difference. To Matt and John: No this certainly isn't homework, I'm 29 and in full time work. I decided to learn to program a

Re: unexplainable python

2009-09-27 Thread D'Arcy J.M. Cain
On Sat, 26 Sep 2009 23:31:25 -0700 John Nagle wrote: > dads wrote: > > Sorry forgot to mention I'm using python 2.6 > > This looks like a homework assignment. So what? He supplied code and showed what he tried so far didn't he? I suppose he could have said that it was homework but maybe it

Re: unexplainable python

2009-09-27 Thread dads
Thank you for the help, it's amazing what you can't spot. It seems the harder you look the less likely you're to find the issue. Fresh eyes make the world of difference. To Matt and John: No this certainly isn't homework, I'm 29 and in full time work. I decided to learn to program about a year ag

Re: unexplainable python

2009-09-27 Thread Matt Joiner
Yes the needless use of classes further supports that theory. On Sun, Sep 27, 2009 at 4:31 PM, John Nagle wrote: > dads wrote: >> >> Sorry forgot to mention I'm using python 2.6 > >   This looks like a homework assignment. > >                                John Nagle > -- > http://mail.python.or

Re: unexplainable python

2009-09-26 Thread John Nagle
dads wrote: Sorry forgot to mention I'm using python 2.6 This looks like a homework assignment. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: unexplainable python

2009-09-26 Thread Dave Angel
dads wrote: When creating a script that converts digits to words I've come across some unexplainable python. The script works fine until I use a 5 digit number and get a 'IndexError: string index out of range'. After looking into it and adding some print calls, it looks like a v

Re: unexplainable python

2009-09-26 Thread Mel
dads wrote: > When creating a script that converts digits to words I've come across > some unexplainable python. The script works fine until I use a 5 digit > number and get a 'IndexError: string index out of range'. After > looking into it and adding some print call

Re: unexplainable python

2009-09-26 Thread tec
dads 写道: ... enter number: 34567 _5digit function used 34 before sent to _2digit 34 slice when at _2digit function 34 before sent to plus_ten function 7 slice when at _2digit function This is the point. _2digit() only gets 1 digit("7") and needs accessing the second byte in: var = self.plu

Re: unexplainable python

2009-09-26 Thread Banibrata Dutta
;t you run the thing in a debugger. It's lot easier than adding prints !! On Sun, Sep 27, 2009 at 8:07 AM, dads wrote: > When creating a script that converts digits to words I've come across > some unexplainable python. The script works fine until I use a 5 digit > number and

Re: unexplainable python

2009-09-26 Thread Chris Rebert
On Sat, Sep 26, 2009 at 7:37 PM, dads wrote: > When creating a script that converts digits to words I've come across > some unexplainable python. The script works fine until I use a 5 digit > number and get a 'IndexError: string index out of range'. Please provide the fu

Re: unexplainable python

2009-09-26 Thread dads
Sorry forgot to mention I'm using python 2.6 -- http://mail.python.org/mailman/listinfo/python-list

unexplainable python

2009-09-26 Thread dads
When creating a script that converts digits to words I've come across some unexplainable python. The script works fine until I use a 5 digit number and get a 'IndexError: string index out of range'. After looking into it and adding some print calls, it looks like a variable change