In article <[EMAIL PROTECTED]>,
godavemon <[EMAIL PROTECTED]> wrote:
>I've been a member for a while but I had no idea how helpful this form
>is. I had a one hour meeting and when I came back there were 4
>replies. Thanks for your help!
>
>
>Scott David Daniels wrote:
>> godavemon wrote:
>> > I n
I've been a member for a while but I had no idea how helpful this form
is. I had a one hour meeting and when I came back there were 4
replies. Thanks for your help!
Scott David Daniels wrote:
> godavemon wrote:
> > I need to take floats and dump out their 4 byte hex representation.
> > This is
godavemon wrote:
> I need to take floats and dump out their 4 byte hex representation.
> This is easy with ints with the built in hex function or even better
> for my purpose
>
> def hex( number, size ):
> s = "%"+str(size) + "X"
> return (s % number).replace(' ', '0')
This should be
On 2006-06-14, godavemon <[EMAIL PROTECTED]> wrote:
> I need to take floats and dump out their 4 byte hex representation.
struct
--
Grant Edwards grante Yow! Darling, my ELBOW
at is FLYING over FRANKFURT,
> s = "%"+str(size) + "X"
> return (s % number).replace(' ', '0')
While I don't have a fast and easy way to represent floats, you
may want to tweak this to be
return ("%0*X" % (size,number))
which will zero-pad the number in hex to "size" number of places
in a single step.
godavemon <[EMAIL PROTECTED]> wrote:
> I need to take floats and dump out their 4 byte hex representation.
> This is easy with ints with the built in hex function or even better
> for my purpose
>
> def hex( number, size ):
> s = "%"+str(size) + "X"
> return (s % number).replace(' ',
I need to take floats and dump out their 4 byte hex representation.
This is easy with ints with the built in hex function or even better
for my purpose
def hex( number, size ):
s = "%"+str(size) + "X"
return (s % number).replace(' ', '0')
but I haven't been able to find anything f