Extracting float from string

Peter Hansen peter at engcorp.com
Mon Jan 13 21:42:35 EST 2003


Spencer Ernest Doidge wrote:
> 
> From a previous post,
> I got many good solutions to extracting an int from
> 'X= 445 A'.
> 
> Now what about this one?
> Somewhere (we don't know where) in this input string, we expect to find a float:
> ':X=  0.22456  A'
> 
> How can I suck the float out of this one?

Since you aren't giving almost any more information about this one
than the last... I'm not going to play any more.

(If you hadn't noticed, you got exactly seven earnest attempts (so far)
at helping you out in spite of a *pitifully inadequate* specification
of your requirements.  I appreciate your glancing expression of
gratefulness above, but in my opinion you are more likely to make
some of us *stop* posting helpful replies to newbies if you 
continue making your requests in this manner.  Help us out a
little here and tell us what the heck you're trying to do!)

(Apologies if this sounds a little petty... maybe I'm just
reacting to too many poorly expressed requests for help lately.
Time for another vacation from newbie-helping, me thinks!)

-Peter




More information about the Python-list mailing list