Hex numbers
Harvey Thomas
hst at empolis.co.uk
Thu Jan 23 05:16:37 EST 2003
Petri Järvinen wrote:
> Hi, I assume that this is a FAQ-question, but I didn't find a
> solution.
>
> I have a string '0xff00ff' and I want to store it as a hex-number not
> string.
>
> Is that possible? I know that I can write to Python shell hexnumbers
> like:
> > a = 0xff00ff
> > a
> 16711953
> > hex(a)
> > '0xff00ff'
>
> What's the trick?
> (I think it should not be possible as hex-is only a representation of
> integer-object.
>
> Second question.
>
> Has anyone ran in to the problem above when using Python interface to
> GDCChart?
>
> - Petri Järvinen
> --
a = '0xff00ff'
print int(a, 16)
16711953
_____________________________________________________________________
This message has been checked for all known viruses by the MessageLabs Virus Scanning Service.
More information about the Python-list
mailing list