[FRPythoneers] Data type conversion

J. Wayde Allen wallen at its.bldrdoc.gov
Wed May 2 10:14:38 MDT 2001

On Wed, 2 May 2001 jafo at tummy.com wrote:

> On Wed, May 02, 2001 at 09:50:51AM -0600, J. Wayde Allen wrote:
> >hhmmss format.  I was thinking something like:
> >
> >         sampletime = string.join((hours,minutes,seconds),'')
> sampletime = '%02d%02d%02f' % ( hours, minutes, seconds )
> You could use something like:
>    string.join(( str(hours), str(minutes), str(seconds) ), '')
> but that's probably not the clearest way to do it, and if you have a
> minutes of 5 you'll get HHMSS, right?  Try the %formatting stuff.

I just tried

         sampletime = (hours,minutes,seconds)
         print datafreq, '%s%s%s' % sampletime, level

and that seems to be on the right track.  Then I get back over here and
see that this is pretty close to what you are suggesting.  Yes, you are
correct that I'd have a problem for single digit minutes and
seconds.  It looks like your format string fixes this though.  Thanks!   

- Wayde
  (wallen at its.bldrdoc.gov)

More information about the FRPythoneers mailing list