Discussion:
Reverse of hex()
Hans Nowak
2000-03-20 22:59:28 UTC
Permalink
Hi,
I'm looking for the reverse of the hex built-in function: is there any?
eval('0xf')
15
string.atoi('0xf', 16)
15

HTH,

--Hans Nowak (zephyrfalcon at hvision.nl)
Homepage: http://www.hvision.nl/~ivnowa/newsite/
Python questions? See http://tor.dhs.org/~zephyrfalcon/snippets
You call me a masterless man. You are wrong. I am my own master.
Moshe Zadka
2000-03-21 05:54:03 UTC
Permalink
Hi,
I'm looking for the reverse of the hex built-in function: is there any?
string.atoi
--
Moshe Zadka <mzadka at geocities.com>.
http://www.oreilly.com/news/prescod_0300.html
http://www.linux.org.il -- we put the penguin in .com
Gaetan Corneau
2000-03-20 16:43:15 UTC
Permalink
Hi,

I'm looking for the reverse of the hex built-in function: is there any?

Thanks,
______________________________________________________
Gaetan Corneau
Software Developer
Copernic Technologies inc.
http://www.copernic.com
E-mail: corg at copernic.com
______________________________________________________
"Tu l'as trop ?cras?, C?sar, ce Port Salut"


-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/B/MU d- s+:++ a C++
UL+ P--- W+ N- K- W++ t--
!5 X- R+ tv-- b++ DI++
G e++ h---- r+++ y++++
------END GEEK CODE BLOCK------
Wilson, Stewart [WDLN2:2X86:EXCH]
2000-03-20 23:01:30 UTC
Permalink
import string
string.atoi(hex(150),0)
150
Hi,
I'm looking for the reverse of the hex built-in function: is there any?
Thanks,
______________________________________________________
Gaetan Corneau
--
---
Stewart Wilson
Nortel Networks Wireless Solutions
wilson at nortelnetworks.com
Gaetan Corneau
2000-03-21 14:09:25 UTC
Permalink
Hans,
eval('0xf')
15
That's what I did while waiting for a "better" answer :)
string.atoi('0xf', 16)
15
I prefer that.

Thanks!
______________________________________________________
Gaetan Corneau
Software Developer
Copernic Technologies inc.
http://www.copernic.com
E-mail: corg at copernic.com
______________________________________________________
"Tu l'as trop ?cras?, C?sar, ce Port Salut"


-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/B/MU d- s+:++ a C++
UL+ P--- W+ N- K- W++ t--
!5 X- R+ tv-- b++ DI++
G e++ h---- r+++ y++++
------END GEEK CODE BLOCK------

Continue reading on narkive:
Loading...