<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2658.2">
<TITLE>RE: Converting hex string to an integer</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>[Rick Holbert]</FONT>
</P>

<P><FONT SIZE=2>#- > Given the character string "0x00A1B2C3" arriving at </FONT>
<BR><FONT SIZE=2>#- sys.argv[1] how do I</FONT>
<BR><FONT SIZE=2>#- > convert that to an integer which I can do some math on?</FONT>
<BR><FONT SIZE=2>#- </FONT>
<BR><FONT SIZE=2>#- i = eval(sys.argv[1])</FONT>
</P>

<P><FONT SIZE=2>This is *DANGEROUS*.</FONT>
</P>

<P><FONT SIZE=2>Never do that.</FONT>
</P>

<P><FONT SIZE=2>You're executing something that you get from the exterior without control! Just think what happens if a pass to the program</FONT></P>

<P>        <FONT SIZE=2>"import os;os.remove('/')"</FONT>
</P>

<P><FONT SIZE=2>.       Facundo</FONT>
</P>

</BODY>
</HTML>