<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Open source blog, linux, php, python, security &#187; dcimal</title>
	<atom:link href="http://www.alonon.net/tag/dcimal/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.alonon.net</link>
	<description></description>
	<lastBuildDate>Wed, 18 Aug 2010 20:03:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>

   <image>
    <title>Open source blog, linux, php, python, security</title>
    <url>http://1.gravatar.com/avatar/5152c5736f5f8dd9570ffb2f9068e8ab?s=</url>
    <link>http://www.alonon.net</link>
   </image>
		<item>
		<title>python hex to dec and dec to hex converter</title>
		<link>http://www.alonon.net/python-hex-to-dec-and-dec-to-he/</link>
		<comments>http://www.alonon.net/python-hex-to-dec-and-dec-to-he/#comments</comments>
		<pubDate>Thu, 10 Dec 2009 17:03:42 +0000</pubDate>
		<dc:creator>ALonon</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[converter]]></category>
		<category><![CDATA[dcimal]]></category>
		<category><![CDATA[hex]]></category>

		<guid isPermaLink="false">http://www.alonon.net/?p=170</guid>
		<description><![CDATA[# change a hexadecimal string to decimal number and reverse # check two different representations of the hexadecimal string # negative values and zero are accepted # tested with Python24        vegaseat     11oct2005 def dec2hex(n): &#8220;&#8221;"return the hexadecimal string representation of integer n&#8221;"&#8221; return &#8220;%X&#8221; % n def hex2dec(s): &#8220;&#8221;"return the integer value of a hexadecimal &#8230; <a href="http://www.alonon.net/python-hex-to-dec-and-dec-to-he/">Read more <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p># change a hexadecimal string to decimal number and reverse<br />
# check two different representations of the hexadecimal string<br />
# negative values and zero are accepted<br />
# tested with Python24        vegaseat     11oct2005</p>
<p>def dec2hex(n):<br />
&#8220;&#8221;"return the hexadecimal string representation of integer n&#8221;"&#8221;<br />
return &#8220;%X&#8221; % n</p>
<p>def hex2dec(s):<br />
&#8220;&#8221;"return the integer value of a hexadecimal string s&#8221;"&#8221;<br />
return int(s, 16)</p>
<p>print &#8220;dec2hex(255)  =&#8221;, dec2hex(255)    # FF<br />
print &#8220;hex2dec(&#8216;FF&#8217;) =&#8221;, hex2dec(&#8216;FF&#8217;)   # 255</p>
<p>print</p>
<p>print &#8220;hex(255) =&#8221;, hex(255)                # 0xff<br />
print &#8220;hex2dec(&#8217;0xff&#8217;) =&#8221;, hex2dec(&#8217;0xff&#8217;)  # 255</p>

	Tags: <a href="http://www.alonon.net/tag/converter/" title="converter" rel="tag">converter</a>, <a href="http://www.alonon.net/tag/dcimal/" title="dcimal" rel="tag">dcimal</a>, <a href="http://www.alonon.net/tag/hex/" title="hex" rel="tag">hex</a>, <a href="http://www.alonon.net/tag/python/" title="Python" rel="tag">Python</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.alonon.net/python-dicts-tuples-and-lists/" title="Python Dicts,Tuples and Lists (April 16, 2010)">Python Dicts,Tuples and Lists</a> (0)</li>
	<li><a href="http://www.alonon.net/phone-book-telefon-defteri-python/" title="Phone Book &#8211; Telefon Defteri Python (April 14, 2010)">Phone Book &#8211; Telefon Defteri Python</a> (2)</li>
	<li><a href="http://www.alonon.net/after-long-break/" title="After long break &#8230; (August 11, 2009)">After long break &#8230;</a> (0)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.alonon.net/python-hex-to-dec-and-dec-to-he/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
