Re: [Tutor] Recognizing real numbers

2012-02-22 Thread Dave Angel
On 02/22/2012 08:54 PM, Michael Lewis wrote: On Wed, Feb 22, 2012 at 2:52 PM, Dave Angel wrote: I actually have a function written in my imported file to check if a string is a valid float, but I didn't use it because I also have raw_input in that same function, which I don't want. I'll rework

Re: [Tutor] Recognizing real numbers

2012-02-22 Thread Michael Lewis
On Wed, Feb 22, 2012 at 2:52 PM, Dave Angel wrote: > On 02/21/2012 10:00 PM, Michael Lewis wrote: > >> Hi everyone, >> >> I have some code where I import a file to use a module. That module that I >> import takes text and a multiplier, checks for any numbers in that text >> and >> will then multi

Re: [Tutor] Recognizing real numbers (bob gailer)

2012-02-22 Thread Michael Lewis
> Hi everyone, > > I have some code where I import a file to use a module. That module > that I import > takes text and a multiplier, checks for any numbers in that text and > will then multiply those numbers by the given multiplier. The imported > module is below. I am getting the text from a fil

Re: [Tutor] Recognizing real numbers

2012-02-22 Thread Joel Goldstick
On Wed, Feb 22, 2012 at 4:35 PM, bob gailer wrote: > On 2/21/2012 10:00 PM, Michael Lewis wrote: > > Hi everyone, > > I have some code where I import a file to use a module. That module that I > import > > takes text and a multiplier, checks for any numbers in that text and will > then multiply th

Re: [Tutor] Recognizing real numbers

2012-02-22 Thread Dave Angel
On 02/21/2012 10:00 PM, Michael Lewis wrote: Hi everyone, I have some code where I import a file to use a module. That module that I import takes text and a multiplier, checks for any numbers in that text and will then multiply those numbers by the given multiplier. The imported module is below.

Re: [Tutor] Recognizing real numbers

2012-02-22 Thread bob gailer
On 2/21/2012 10:00 PM, Michael Lewis wrote: Hi everyone, I have some code where I import a file to use a module. That module that I import takes text and a multiplier, checks for any numbers in that text and will then multiply those numbers by the given multiplier. The imported module is belo

Re: [Tutor] Recognizing real numbers

2012-02-21 Thread Steven D'Aprano
On Tue, Feb 21, 2012 at 07:00:40PM -0800, Michael Lewis wrote: > It seems that the .isdigit() function that I use doesn't recognize the .5 > as a number and therefore doesn't multiply it. How can I get my code to > recognize numbers such as .5, 1.75 as numbers? As the saying goes, it is often Eas

[Tutor] Recognizing real numbers

2012-02-21 Thread Michael Lewis
Hi everyone, I have some code where I import a file to use a module. That module that I import takes text and a multiplier, checks for any numbers in that text and will then multiply those numbers by the given multiplier. The imported module is below. I am getting the text from a file that I have