Re: Bullet proof passing numeric values from NMEA data stream.

2007-03-20 Thread Doug Gray
On Wed, 21 Mar 2007 00:29:00 +1100, Steven D'Aprano wrote: > On Tue, 20 Mar 2007 12:09:29 +, Doug Gray wrote: > >> Folks, >> I am looking for a fast but most importantly a bullet proof method to pass >> and NMEA data stream (GPS output) ascii numeric strings. The best I can >> offer is: >> >

Re: Bullet proof passing numeric values from NMEA data stream.

2007-03-20 Thread Steven D'Aprano
On Wed, 21 Mar 2007 00:29:00 +1100, Steven D'Aprano wrote: > All your examples include spurious whitespace. If that is the only > problem, here's a simple fix: > > def despace(s): > """Remove whitespace from string s.""" > return Gah! Ignore that stub. I forgot to delete it :( While I

Re: Bullet proof passing numeric values from NMEA data stream.

2007-03-20 Thread Steven D'Aprano
On Tue, 20 Mar 2007 12:09:29 +, Doug Gray wrote: > Folks, > I am looking for a fast but most importantly a bullet proof method to pass > and NMEA data stream (GPS output) ascii numeric strings. The best I can > offer is: > > def fint(a): > try: return int(float(a)) > except: return 0 Will

Re: Bullet proof passing numeric values from NMEA data stream.

2007-03-20 Thread Steve Holden
Doug Gray wrote: > Folks, > I am looking for a fast but most importantly a bullet proof method to pass > and NMEA data stream (GPS output) ascii numeric strings. The best I can > offer is: > > def fint(a): > try: return int(float(a)) > except: return 0 > > The reason for this is the quality of