number base conversion? (ASCII to Hex)
chibaA at TinterlogD.Tcom
chibaA at TinterlogD.Tcom
Thu May 11 18:16:12 EDT 2000
Alright... I'm still confused (probably because I'm not asking the
right question). hex(word('1')) requires (I'm assuming) an
integer/character input - and word[1] provides a string. So it won't
work.
Here's the root of what I'm trying to do (maybe it'll explain why I'm
trying to do this:
I'm creating a script which outputs a call to another python script
with arguments. The second program reads in values in CGI format - so
I have to output all of the arguments in this fashion. Maybe there's
a mod that already does this (CGI does not - that only goes the other
way).
kc
On Thu, 11 May 2000 18:06:36 -0400, William Park <parkw at better.net>
wrote:
>On Thu, May 11, 2000 at 09:54:26PM +0000, chibaA at TinterlogD.Tcom wrote:
>> How would I go about getting the base-16(hex) value of a character,
>> into a string?
>>
>> take character word[1] (for example)
>> and retrieve the hex value of 31
>> and assign it to value hexValue in an ascii format (ie. as the number
>> 31).
>
>hex(ord('1'))
>
>--William
>
More information about the Python-list
mailing list