<?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>The Mouse Vs. The Python &#187; Python</title>
	<atom:link href="http://www.blog.pythonlibrary.org/category/python/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.blog.pythonlibrary.org</link>
	<description>Python Programming from the Frontlines</description>
	<lastBuildDate>Sun, 08 Jan 2012 12:45:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Reportlab: Converting Hundreds of Images Into PDFs</title>
		<link>http://www.blog.pythonlibrary.org/2012/01/07/reportlab-converting-hundreds-of-images-into-pdfs/</link>
		<comments>http://www.blog.pythonlibrary.org/2012/01/07/reportlab-converting-hundreds-of-images-into-pdfs/#comments</comments>
		<pubDate>Sun, 08 Jan 2012 01:36:41 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Reportlab]]></category>

		<guid isPermaLink="false">http://www.blog.pythonlibrary.org/?p=2188</guid>
		<description><![CDATA[I was recently asked to convert a few hundred images into PDF pages. A friend of mine draws comics and my brother wanted to be able to read them on a tablet. Alas, if you had a bunch of files named something like this: 'Jia_01.Jpg', 'Jia_02.Jpg', 'Jia_09.Jpg', 'Jia_10.Jpg', 'Jia_11.Jpg', 'Jia_101.Jpg' the Android tablet would reorder [...]]]></description>
			<content:encoded><![CDATA[<div class="socialize-in-content" style="float:left;"><div class="socialize-in-button socialize-in-button-left"><a href="http://twitter.com/share" class="twitter-share-button" data-counturl="http://www.blog.pythonlibrary.org/2012/01/07/reportlab-converting-hundreds-of-images-into-pdfs/" data-url="http://bit.ly/xIgjvX" data-text="Reportlab: Converting Hundreds of Images Into PDFs" data-count="vertical" data-via="socializeWP" ><!--Tweetter--></a></div><div class="socialize-in-button socialize-in-button-left"><iframe src="http://www.facebook.com/plugins/like.php?href=http://www.blog.pythonlibrary.org/2012/01/07/reportlab-converting-hundreds-of-images-into-pdfs/&amp;layout=button_count&amp;show_faces=true&amp;width=100&amp;action=like&amp;font=arial&amp;colorscheme=light&amp;height=65" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px !important; height:65px;" allowTransparency="true"></iframe></div><div class="socialize-in-button socialize-in-button-left"><script type="text/javascript">
			<!-- 
			reddit_url = "http://www.blog.pythonlibrary.org/2012/01/07/reportlab-converting-hundreds-of-images-into-pdfs/";
			reddit_title = "Reportlab: Converting Hundreds of Images Into PDFs";	//-->
		</script><script type="text/javascript" src="http://www.reddit.com/static/button/button2.js"></script></div><div class="socialize-in-button socialize-in-button-left"><g:plusone size="small" href="http://www.blog.pythonlibrary.org/2012/01/07/reportlab-converting-hundreds-of-images-into-pdfs/"></g:plusone></div></div><p>I was recently asked to convert a few hundred images into PDF pages. A friend of mine draws comics and my brother wanted to be able to read them on a tablet. Alas, if you had a bunch of files named something like this: </p>
<p><code><br />
'Jia_01.Jpg', 'Jia_02.Jpg', 'Jia_09.Jpg', 'Jia_10.Jpg', 'Jia_11.Jpg', 'Jia_101.Jpg'<br />
</code></p>
<p>the Android tablet would reorder them into something like this:</p>
<p><code><br />
'Jia_01.Jpg', 'Jia_02.Jpg', 'Jia_09.Jpg', 'Jia_10.Jpg', 'Jia_101.Jpg', 'Jia_11.Jpg'<br />
</code></p>
<p>And it got pretty confusing the more files you had that were out of order. Sadly, even Python sorts files this way. I tried using the <strong>glob</strong> module on the directly and then sorting the result and got the exact same issue. So the first thing I had to do was find some kind of sorting algorithm that could sort them correctly. It should be noted that Windows 7 can sort the files correctly in its file system, even though Python cannot. <span id="more-2188"></span></p>
<p>After a little searching on Google, I found the following script on <a href="# http://stackoverflow.com/questions/2669059/how-to-sort-alpha-numeric-set-in-python" target="_blank">StackOverflow</a>:</p>
<pre class="python"><span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">re</span>
&nbsp;
<span style="color: #808080; font-style: italic;">#----------------------------------------------------------------------</span>
<span style="color: #ff7700;font-weight:bold;">def</span> sorted_nicely<span style="color: black;">&#40;</span> l <span style="color: black;">&#41;</span>:
    <span style="color: #483d8b;">&quot;&quot;</span><span style="color: #483d8b;">&quot;
    Sort the given iterable in the way that humans expect.
    &quot;</span><span style="color: #483d8b;">&quot;&quot;</span>
    convert = <span style="color: #ff7700;font-weight:bold;">lambda</span> text: <span style="color: #008000;">int</span><span style="color: black;">&#40;</span>text<span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">if</span> text.<span style="color: black;">isdigit</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">else</span> text
    alphanum_key = <span style="color: #ff7700;font-weight:bold;">lambda</span> key: <span style="color: black;">&#91;</span> convert<span style="color: black;">&#40;</span>c<span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">for</span> c <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #dc143c;">re</span>.<span style="color: black;">split</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'([0-9]+)'</span>, key<span style="color: black;">&#41;</span> <span style="color: black;">&#93;</span>
    <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #008000;">sorted</span><span style="color: black;">&#40;</span>l, key = alphanum_key<span style="color: black;">&#41;</span></pre>
<p>That worked perfectly! Now I just had to find a way to put each comic page on their own PDF page. Fortunately, the <a href="http://www.reportlab.com/software/opensource/" target="_blank">reportlab</a> library makes this pretty easy to accomplish. You just need to iterate over the images and insert them one at a time onto a page. It&#8217;s easier to just look at the code, so let&#8217;s do that:</p>
<pre class="python"><span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">glob</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">os</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">re</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">from</span> reportlab.<span style="color: black;">lib</span>.<span style="color: black;">pagesizes</span> <span style="color: #ff7700;font-weight:bold;">import</span> letter
<span style="color: #ff7700;font-weight:bold;">from</span> reportlab.<span style="color: black;">platypus</span> <span style="color: #ff7700;font-weight:bold;">import</span> SimpleDocTemplate, Paragraph, Image, PageBreak
<span style="color: #ff7700;font-weight:bold;">from</span> reportlab.<span style="color: black;">lib</span>.<span style="color: black;">units</span> <span style="color: #ff7700;font-weight:bold;">import</span> inch
&nbsp;
<span style="color: #808080; font-style: italic;">#----------------------------------------------------------------------</span>
<span style="color: #ff7700;font-weight:bold;">def</span> sorted_nicely<span style="color: black;">&#40;</span> l <span style="color: black;">&#41;</span>:
    <span style="color: #483d8b;">&quot;&quot;</span><span style="color: #483d8b;">&quot;
    # http://stackoverflow.com/questions/2669059/how-to-sort-alpha-numeric-set-in-python
&nbsp;
    Sort the given iterable in the way that humans expect.
    &quot;</span><span style="color: #483d8b;">&quot;&quot;</span>
    convert = <span style="color: #ff7700;font-weight:bold;">lambda</span> text: <span style="color: #008000;">int</span><span style="color: black;">&#40;</span>text<span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">if</span> text.<span style="color: black;">isdigit</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">else</span> text
    alphanum_key = <span style="color: #ff7700;font-weight:bold;">lambda</span> key: <span style="color: black;">&#91;</span> convert<span style="color: black;">&#40;</span>c<span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">for</span> c <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #dc143c;">re</span>.<span style="color: black;">split</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'([0-9]+)'</span>, key<span style="color: black;">&#41;</span> <span style="color: black;">&#93;</span>
    <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #008000;">sorted</span><span style="color: black;">&#40;</span>l, key = alphanum_key<span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">#----------------------------------------------------------------------</span>
<span style="color: #ff7700;font-weight:bold;">def</span> create_comic<span style="color: black;">&#40;</span>fname, front_cover, back_cover, path<span style="color: black;">&#41;</span>:
    <span style="color: #483d8b;">&quot;&quot;</span><span style="color: #483d8b;">&quot;&quot;</span><span style="color: #483d8b;">&quot;&quot;</span>
    filename = <span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">join</span><span style="color: black;">&#40;</span>path, fname + <span style="color: #483d8b;">&quot;.pdf&quot;</span><span style="color: black;">&#41;</span>
    doc = SimpleDocTemplate<span style="color: black;">&#40;</span>filename,pagesize=letter,
                            rightMargin=<span style="color: #ff4500;">72</span>,leftMargin=<span style="color: #ff4500;">72</span>,
                            topMargin=<span style="color: #ff4500;">72</span>,bottomMargin=<span style="color: #ff4500;">18</span><span style="color: black;">&#41;</span>
    Story=<span style="color: black;">&#91;</span><span style="color: black;">&#93;</span>
    width = <span style="color: #ff4500;">7.5</span><span style="color: #66cc66;">*</span>inch
    height = <span style="color: #ff4500;">9.5</span><span style="color: #66cc66;">*</span>inch
&nbsp;
    pictures = sorted_nicely<span style="color: black;">&#40;</span><span style="color: #dc143c;">glob</span>.<span style="color: #dc143c;">glob</span><span style="color: black;">&#40;</span>path + <span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\\</span>%s*&quot;</span> <span style="color: #66cc66;">%</span> fname<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
&nbsp;
    Story.<span style="color: black;">append</span><span style="color: black;">&#40;</span>Image<span style="color: black;">&#40;</span>front_cover, width, height<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
    Story.<span style="color: black;">append</span><span style="color: black;">&#40;</span>PageBreak<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
&nbsp;
    x = <span style="color: #ff4500;">0</span>
    page_nums = <span style="color: black;">&#123;</span><span style="color: #ff4500;">100</span>:<span style="color: #483d8b;">'%s_101-200.pdf'</span>, <span style="color: #ff4500;">200</span>:<span style="color: #483d8b;">'%s_201-300.pdf'</span>,
                 <span style="color: #ff4500;">300</span>:<span style="color: #483d8b;">'%s_301-400.pdf'</span>, <span style="color: #ff4500;">400</span>:<span style="color: #483d8b;">'%s_401-500.pdf'</span>,
                 <span style="color: #ff4500;">500</span>:<span style="color: #483d8b;">'%s_end.pdf'</span><span style="color: black;">&#125;</span>
    <span style="color: #ff7700;font-weight:bold;">for</span> pic <span style="color: #ff7700;font-weight:bold;">in</span> pictures:
        parts = pic.<span style="color: black;">split</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;<span style="color: #000099; font-weight: bold;">\\</span>&quot;</span><span style="color: black;">&#41;</span>
        p = parts<span style="color: black;">&#91;</span><span style="color: #ff4500;">-1</span><span style="color: black;">&#93;</span>.<span style="color: black;">split</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;%s&quot;</span> <span style="color: #66cc66;">%</span> fname<span style="color: black;">&#41;</span>
        page_num = <span style="color: #008000;">int</span><span style="color: black;">&#40;</span>p<span style="color: black;">&#91;</span><span style="color: #ff4500;">-1</span><span style="color: black;">&#93;</span>.<span style="color: black;">split</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;.&quot;</span><span style="color: black;">&#41;</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;page_num =&gt; &quot;</span>, page_num
&nbsp;
        im = Image<span style="color: black;">&#40;</span>pic, width, height<span style="color: black;">&#41;</span>
        Story.<span style="color: black;">append</span><span style="color: black;">&#40;</span>im<span style="color: black;">&#41;</span>
        Story.<span style="color: black;">append</span><span style="color: black;">&#40;</span>PageBreak<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
&nbsp;
        <span style="color: #ff7700;font-weight:bold;">if</span> page_num <span style="color: #ff7700;font-weight:bold;">in</span> page_nums.<span style="color: black;">keys</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
            <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;%s created&quot;</span> <span style="color: #66cc66;">%</span> filename
            doc.<span style="color: black;">build</span><span style="color: black;">&#40;</span>Story<span style="color: black;">&#41;</span>
            filename = <span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">join</span><span style="color: black;">&#40;</span>path, page_nums<span style="color: black;">&#91;</span>page_num<span style="color: black;">&#93;</span> <span style="color: #66cc66;">%</span> fname<span style="color: black;">&#41;</span>
            doc = SimpleDocTemplate<span style="color: black;">&#40;</span>filename,
                                    pagesize=letter,
                                    rightMargin=<span style="color: #ff4500;">72</span>,leftMargin=<span style="color: #ff4500;">72</span>,
                                    topMargin=<span style="color: #ff4500;">72</span>,bottomMargin=<span style="color: #ff4500;">18</span><span style="color: black;">&#41;</span>
            Story=<span style="color: black;">&#91;</span><span style="color: black;">&#93;</span>
        <span style="color: #ff7700;font-weight:bold;">print</span> pic
        x += <span style="color: #ff4500;">1</span>
&nbsp;
    Story.<span style="color: black;">append</span><span style="color: black;">&#40;</span>Image<span style="color: black;">&#40;</span>back_cover, width, height<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
    doc.<span style="color: black;">build</span><span style="color: black;">&#40;</span>Story<span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;%s created&quot;</span> <span style="color: #66cc66;">%</span> filename
&nbsp;
<span style="color: #808080; font-style: italic;">#----------------------------------------------------------------------</span>
<span style="color: #ff7700;font-weight:bold;">if</span> __name__ == <span style="color: #483d8b;">&quot;__main__&quot;</span>:
    path = r<span style="color: #483d8b;">&quot;C:<span style="color: #000099; font-weight: bold;">\U</span>sers<span style="color: #000099; font-weight: bold;">\M</span>ike<span style="color: #000099; font-weight: bold;">\D</span>esktop<span style="color: #000099; font-weight: bold;">\S</span>am's Comics&quot;</span>
    front_cover = <span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">join</span><span style="color: black;">&#40;</span>path, <span style="color: #483d8b;">&quot;FrontCover.jpg&quot;</span><span style="color: black;">&#41;</span>
    back_cover = <span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">join</span><span style="color: black;">&#40;</span>path, <span style="color: #483d8b;">&quot;BackCover2.jpg&quot;</span><span style="color: black;">&#41;</span>
    create_comic<span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;Jia_&quot;</span>, front_cover, back_cover, path<span style="color: black;">&#41;</span></pre>
<p>Let&#8217;s break this down a bit. As usual, you have some necessary imports that are required for this code to work. You&#8217;ll note we also have that <strong>sorted_nicely</strong> function that we talked about earlier is in this code too. The main function is called <strong>create_comic</strong> and takes four arguments: fname, front_cover, back_cover, path. If you have used the reportlab toolkit before, then you&#8217;ll recognize the SimpleDocTemplate and the Story list as they&#8217;re straight out of the reportlab tutorial.</p>
<p>Anyway, you loop over the sorted pictures and add the image to the Story along with a PageBreak object. The reason there&#8217;s a conditional in the loop is because I discovered that if I tried to build the PDF with all 400+ images, I would run into a memory error. So I broke it up into a series of PDF documents that were 100 pages or less. At the end of the document, you have to call the <strong>doc</strong> object&#8217;s <strong>build</strong> method to actually create the PDF document.</p>
<p>Now you know how I ended up writing a whole slew of images into multiple PDF documents. Theoretically, you could use PyPdf to knit all the resulting PDFs together into one PDF, but I didn&#8217;t try it. You might end up with another memory error. I&#8217;ll leave that as an exercise for the reader.</p>
<h2>Source Code</h2>
<ul>
<li><a href='http://www.blog.pythonlibrary.org/wp-content/uploads/2012/01/comic_maker.zip'>comic_maker.zip</a></li>
<li><a href='http://www.blog.pythonlibrary.org/wp-content/uploads/2012/01/comic_maker.tar'>comic_maker.tar</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.pythonlibrary.org/2012/01/07/reportlab-converting-hundreds-of-images-into-pdfs/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>January 2012 Pyowa Wrap Up</title>
		<link>http://www.blog.pythonlibrary.org/2012/01/07/january-2012-pyowa-wrap-up/</link>
		<comments>http://www.blog.pythonlibrary.org/2012/01/07/january-2012-pyowa-wrap-up/#comments</comments>
		<pubDate>Sat, 07 Jan 2012 16:06:00 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Pyowa]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[wxPython]]></category>

		<guid isPermaLink="false">http://www.blog.pythonlibrary.org/?p=2183</guid>
		<description><![CDATA[Last Thursday (the 5th) I attended Pyowa, the local Iowa Python Users group I founded a few years ago. We had Scott Peterson from Principal Financial Group come and talk to us about Library Gadget, a cool Django-based website he created to track what library books his family has checked out. Now he has lots [...]]]></description>
			<content:encoded><![CDATA[<div class="socialize-in-content" style="float:left;"><div class="socialize-in-button socialize-in-button-left"><a href="http://twitter.com/share" class="twitter-share-button" data-counturl="http://www.blog.pythonlibrary.org/2012/01/07/january-2012-pyowa-wrap-up/" data-url="http://bit.ly/zjs7vA" data-text="January 2012 Pyowa Wrap Up" data-count="vertical" data-via="socializeWP" ><!--Tweetter--></a></div><div class="socialize-in-button socialize-in-button-left"><iframe src="http://www.facebook.com/plugins/like.php?href=http://www.blog.pythonlibrary.org/2012/01/07/january-2012-pyowa-wrap-up/&amp;layout=button_count&amp;show_faces=true&amp;width=100&amp;action=like&amp;font=arial&amp;colorscheme=light&amp;height=65" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px !important; height:65px;" allowTransparency="true"></iframe></div><div class="socialize-in-button socialize-in-button-left"><script type="text/javascript">
			<!-- 
			reddit_url = "http://www.blog.pythonlibrary.org/2012/01/07/january-2012-pyowa-wrap-up/";
			reddit_title = "January 2012 Pyowa Wrap Up";	//-->
		</script><script type="text/javascript" src="http://www.reddit.com/static/button/button2.js"></script></div><div class="socialize-in-button socialize-in-button-left"><g:plusone size="small" href="http://www.blog.pythonlibrary.org/2012/01/07/january-2012-pyowa-wrap-up/"></g:plusone></div></div><p>Last Thursday (the 5th) I attended <a href="http://www.pyowa.org/" target="_blank">Pyowa</a>, the local Iowa Python Users group I founded a few years ago. We had Scott Peterson from Principal Financial Group come and talk to us about <a href="http://www.librarygadget.com/" target="_blank">Library Gadget</a>, a cool Django-based website he created to track what library books his family has checked out. Now he has lots of users using his website. It not only tracks the books you have borrowed, but it&#8217;ll auto-renew them if it can and let you know if you&#8217;re books are overdue.</p>
<p>He spent most of his time talking about the backend stuff behind the website though. Such as why he chose Amazon Web Services, how he uses <a href="http://projects.puppetlabs.com/projects/puppet" target="_blank">Puppet</a>, <a href="http://vagrantup.com/docs/getting-started/setup.html" target="_blank">Vagrant</a> and <a href="http://docs.fabfile.org/en/1.3.3/index.html" target="_blank">Fabric</a> to manage his server&#8217;s settings and back them up.</p>
<p>The second talk was done by myself and I spoke on my <a href="http://www.medialocker.pythonlibrary.org/" target="_blank">MediaLocker</a> project, an open source wxPython application that is supposed to help you track your media library. Most of my time was spent telling the story behind the project and showing a demo. Then I took some questions. </p>
<p>Overall, I&#8217;d say that we had a really good meeting with 10 people showing up. Next month, on February 2nd, we&#8217;re bringing in the BIG guns though. We have <a href="http://www.doughellmann.com/" target="_blank">Doug Hellman</a> and <a href="http://holdenweb.com/" target="_blank">Steve Holden</a> scheduled to Skype in and talk to us.</p>
<p>Doug Hellman is the author of <a href="http://www.amazon.com/gp/product/0321767349/ref=as_li_ss_tl?ie=UTF8&#038;tag=thmovsthpy-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=0321767349" target="_blank" rel="nofollow">The Python Standard Library By Example</a>, is a senior developer with Racemi, Inc., and communications director of the Python Software Foundation. He has programmed with Python since version 1.4, and has worked on multiple platforms in mapping, medical publishing, banking, and data center automation. Hellmann was previously columnist and editor-in-chief for Python Magazine and, since 2007, has blogged the popular Python Module of the Week</p>
<p>Steve Holden is chairman of the Python Software Foundation and author of <a href="http://www.amazon.com/gp/product/0735710902/ref=as_li_ss_tl?ie=UTF8&#038;tag=thmovsthpy-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=0735710902" target="_blank" rel="nofollow">Python Web Programming</a>. He owns Python consulting business and does Python training.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.pythonlibrary.org/2012/01/07/january-2012-pyowa-wrap-up/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Top Ten Articles of 2011</title>
		<link>http://www.blog.pythonlibrary.org/2011/12/31/top-ten-articles-of-2011/</link>
		<comments>http://www.blog.pythonlibrary.org/2011/12/31/top-ten-articles-of-2011/#comments</comments>
		<pubDate>Sun, 01 Jan 2012 05:59:27 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Advocacy]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Top ten]]></category>

		<guid isPermaLink="false">http://www.blog.pythonlibrary.org/?p=2175</guid>
		<description><![CDATA[Everyone likes retrospective articles. I&#8217;m not sure why, but lists just pull people in. Last year, my top ten list was pretty popular, so this year I&#8217;m going to do it again. This year I hit 247,901 visits and 345,452 page views over the course of the year compared with 137,727 visits and 213,814 page [...]]]></description>
			<content:encoded><![CDATA[<div class="socialize-in-content" style="float:left;"><div class="socialize-in-button socialize-in-button-left"><a href="http://twitter.com/share" class="twitter-share-button" data-counturl="http://www.blog.pythonlibrary.org/2011/12/31/top-ten-articles-of-2011/" data-url="http://bit.ly/uaC41g" data-text="Top Ten Articles of 2011" data-count="vertical" data-via="socializeWP" ><!--Tweetter--></a></div><div class="socialize-in-button socialize-in-button-left"><iframe src="http://www.facebook.com/plugins/like.php?href=http://www.blog.pythonlibrary.org/2011/12/31/top-ten-articles-of-2011/&amp;layout=button_count&amp;show_faces=true&amp;width=100&amp;action=like&amp;font=arial&amp;colorscheme=light&amp;height=65" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px !important; height:65px;" allowTransparency="true"></iframe></div><div class="socialize-in-button socialize-in-button-left"><script type="text/javascript">
			<!-- 
			reddit_url = "http://www.blog.pythonlibrary.org/2011/12/31/top-ten-articles-of-2011/";
			reddit_title = "Top Ten Articles of 2011";	//-->
		</script><script type="text/javascript" src="http://www.reddit.com/static/button/button2.js"></script></div><div class="socialize-in-button socialize-in-button-left"><g:plusone size="small" href="http://www.blog.pythonlibrary.org/2011/12/31/top-ten-articles-of-2011/"></g:plusone></div></div><p>Everyone likes retrospective articles. I&#8217;m not sure why, but lists just pull people in. Last year, my <a href="http://www.blog.pythonlibrary.org/2010/12/30/top-ten-articles-of-2010/" target="_blank">top ten list</a> was pretty popular, so this year I&#8217;m going to do it again. This year I hit 247,901 visits and 345,452 page views over the course of the year compared with 137,727 visits and 213,814 page views last year. </p>
<ol>
<li><a href="http://www.blog.pythonlibrary.org/2010/03/08/a-simple-step-by-step-reportlab-tutorial/" target="_blank">A Simple Step-by-Step Reportlab Tutorial</a></li>
<p> with 16,378 page views, posted 03/08/2010</p>
<li><a href="http://www.blog.pythonlibrary.org/2010/05/14/how-to-send-email-with-python/" target="_blank">How to Send Email with Python</a> with 11,459 page views, posted 05/14/2010</li>
<li><a href="http://www.blog.pythonlibrary.org/2010/08/12/a-cx_freeze-tutorial-build-a-binary-series/" target="_blank">A cx_Freeze Tutorial</a> – Build a Binary Series! with 9,735 page views, posted 08/12/2010</li>
<li><a href="http://www.blog.pythonlibrary.org/2010/07/16/python-and-microsoft-office-using-pywin32/" target="_blank">Python and Microsoft Office – Using PyWin32</a> with 9,336 page views, posted 07/16/2010</li>
<li><a href="http://www.blog.pythonlibrary.org/2010/02/03/another-step-by-step-sqlalchemy-tutorial-part-1-of-2/" target="_blank">Another Step-by-Step SqlAlchemy Tutorial</a> (part 1 of 2) with 7,990 page views, posted 02/03/2010</li>
<li><a href="http://www.blog.pythonlibrary.org/2010/11/12/python-parsing-xml-with-minidom/" target="_blank">Python: Parsing XML with minidom</a> with 7,900 page views, posted 11/12/2010</li>
<li><a href="http://www.blog.pythonlibrary.org/2010/05/15/manipulating-pdfs-with-python-and-pypdf/" target="_blank">Manipulating PDFs with Python and pyPdf</a> with 7,304 page views, posted 05/15/2010</li>
<li><a href="http://www.blog.pythonlibrary.org/2011/01/04/wxpython-wx-listctrl-tips-and-tricks/" target="_blank">wxPython: wx.ListCtrl Tips and Tricks</a> with 7,265 page views, posted 01/04/2011</li>
<li><a href="http://www.blog.pythonlibrary.org/2010/09/21/reportlab-tables-creating-tables-in-pdfs-with-python/" target="_blank">Reportlab Tables – Creating Tables in PDFs with Python</a> with 6,634 page views, posted 09/21/2010</li>
<li><a href="http://www.blog.pythonlibrary.org/2010/09/04/python-101-how-to-open-a-file-or-program/" target="_blank">Python 101: How to Open a File or Program</a> with 6,440 page views, posted 09/04/2010</li>
</ol>
<p>Last time, I thought I&#8217;d get some articles written about other GUI toolkits during 2011, but I never really got into any. Instead, I wrote a lot of wxPython articles. As you can tell from the list above, they weren&#8217;t super popular with only one making the top ten. Maybe this year I&#8217;ll spread out a bit and actually look at some of the other GUI toolkits. I&#8217;m also planning to write more on the topics that made it into my top ten list two years running such as reportlab and SqlAlchemy. If you can think of anything involving those 3 topics that you&#8217;d like to know more about, feel free to ask in the comments and I&#8217;ll consider writing about it. </p>
<p>I hope you&#8217;re ready for another rocking year of Python programming. I know I am! </p>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.pythonlibrary.org/2011/12/31/top-ten-articles-of-2011/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>New Year&#8217;s Python Meme &#8211; #2012pythonmeme</title>
		<link>http://www.blog.pythonlibrary.org/2011/12/21/new-years-python-meme-2012pythonmeme/</link>
		<comments>http://www.blog.pythonlibrary.org/2011/12/21/new-years-python-meme-2012pythonmeme/#comments</comments>
		<pubDate>Thu, 22 Dec 2011 02:15:30 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.blog.pythonlibrary.org/?p=2161</guid>
		<description><![CDATA[I was reading the Python blog feed yesterday and stumbled on Tarek Ziade&#8217;s Python Meme article. I thought it sounded like a fun idea, so here&#8217;s my answers to his questions. 1. What’s the coolest Python application, framework or library you have discovered in 2011? I can&#8217;t think of anything new that I&#8217;ve really used [...]]]></description>
			<content:encoded><![CDATA[<div class="socialize-in-content" style="float:left;"><div class="socialize-in-button socialize-in-button-left"><a href="http://twitter.com/share" class="twitter-share-button" data-counturl="http://www.blog.pythonlibrary.org/2011/12/21/new-years-python-meme-2012pythonmeme/" data-url="http://bit.ly/v8J1aJ" data-text="New Year&#8217;s Python Meme &#8211; #2012pythonmeme" data-count="vertical" data-via="socializeWP" ><!--Tweetter--></a></div><div class="socialize-in-button socialize-in-button-left"><iframe src="http://www.facebook.com/plugins/like.php?href=http://www.blog.pythonlibrary.org/2011/12/21/new-years-python-meme-2012pythonmeme/&amp;layout=button_count&amp;show_faces=true&amp;width=100&amp;action=like&amp;font=arial&amp;colorscheme=light&amp;height=65" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px !important; height:65px;" allowTransparency="true"></iframe></div><div class="socialize-in-button socialize-in-button-left"><script type="text/javascript">
			<!-- 
			reddit_url = "http://www.blog.pythonlibrary.org/2011/12/21/new-years-python-meme-2012pythonmeme/";
			reddit_title = "New Year&#8217;s Python Meme &#8211; #2012pythonmeme";	//-->
		</script><script type="text/javascript" src="http://www.reddit.com/static/button/button2.js"></script></div><div class="socialize-in-button socialize-in-button-left"><g:plusone size="small" href="http://www.blog.pythonlibrary.org/2011/12/21/new-years-python-meme-2012pythonmeme/"></g:plusone></div></div><p>I was reading the Python blog feed yesterday and stumbled on Tarek Ziade&#8217;s <a href="http://tarekziade.wordpress.com/2011/12/20/new-years-python-meme-2/" target="_blank">Python Meme article</a>. I thought it sounded like a fun idea, so here&#8217;s my answers to his questions. <span id="more-2161"></span></p>
<p><strong>1. What’s the coolest Python application, framework or library you have discovered in 2011?</strong></p>
<p>I can&#8217;t think of anything new that I&#8217;ve really used this year. However, this was the year that I started using the <a href="http://pypi.python.org/pypi/ObjectListView" target="_blank">ObjectListView </a>widget in wxPython pretty extensively. It&#8217;s a great wrapper around the wx.ListCtrl that just makes it super easy to use. This is also the year that I started working on a big <a href="http://turbogears.org/" target="_blank">TurboGears 2</a> project, but I haven&#8217;t decided if it&#8217;s my favorite yet.</p>
<p><strong>2. What new programming technique did you learn in 2011?</strong></p>
<p>Lately I&#8217;ve taken to keeping my code more organized and structured than I have in the past, splitting my components into different modules, refactoring a lot more, trying to follow the Model-View-Controller schema more, etc. I have also started using <a href="http://mercurial.selenic.com/" target="_blank">Mercurial</a> source control and <a href="https://bitbucket.org/" target="_blank">BitBucket</a> much more this year. I&#8217;m still not an expert in using them, but I know enough to keep my source mostly safe.</p>
<p><strong>3. What’s the name of the open source project you contributed the most in 2011? What did you do?</strong></p>
<p><strong>wxPython</strong>. I write a lot of documentation for it on my wiki and I help lots of people with understanding it on the wxPython mailing list and on StackOverflow.</p>
<p><strong>4. What was the Python blog or website you read the most in 2011?</strong></p>
<p>Umm, this is a tough one. I read <a href="http://ramblings.timgolden.me.uk/" target="_blank">Tim Golden&#8217;s</a> a lot with a dash of <a href="http://jessenoller.com/" target="_blank">Jesse Noller</a> and <a href="http://blog.doughellmann.com/" target="_blank">Doug Hellman</a>. I like <a href="http://www.dabeaz.com/blog.html" target="_blank">David Beazley</a> too, but he doesn&#8217;t write much.</p>
<p><strong>5. What are the three top things you want to learn in 2012?</strong></p>
<p>I need to get a better handle on Mercurial branching and merging. Learning more TurboGears and maybe another Python web framework. Testing (I know some, but not enough, especially as related to GUIs).</p>
<p><strong>6. What are the top software, app or lib you wish someone would write in 2012?</strong></p>
<p>I wish there was a better eBay wrapper. I&#8217;d like to write my own sniper script. Another nice one would be some kind of all-in-one script that could create my bit.ly link for my blog post and then submit it to the various major tech sites for me.</p>
<p>Want to do your own list? here’s how:</p>
<ul>
<li>copy-paste the questions and answer to them in your blog</li>
<li>tweet it with the <a href="https://twitter.com/#!/search/%232012pythonmeme" target="_blank">#2012pythonmeme</a> hashtag</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.pythonlibrary.org/2011/12/21/new-years-python-meme-2012pythonmeme/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>wxPython 101: Creating Taskbar Icons</title>
		<link>http://www.blog.pythonlibrary.org/2011/12/13/wxpython-101-creating-taskbar-icons/</link>
		<comments>http://www.blog.pythonlibrary.org/2011/12/13/wxpython-101-creating-taskbar-icons/#comments</comments>
		<pubDate>Wed, 14 Dec 2011 02:27:30 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[wxPython]]></category>

		<guid isPermaLink="false">http://www.blog.pythonlibrary.org/?p=1997</guid>
		<description><![CDATA[Have you ever wondered how to create those little status icons in the Windows System Tray that usually appear on the lower right of your screen? The wxPython toolkit provides a pretty simple way to do just that and this article will walk you through the process. Working the Code For reasons I don&#8217;t quite [...]]]></description>
			<content:encoded><![CDATA[<div class="socialize-in-content" style="float:left;"><div class="socialize-in-button socialize-in-button-left"><a href="http://twitter.com/share" class="twitter-share-button" data-counturl="http://www.blog.pythonlibrary.org/2011/12/13/wxpython-101-creating-taskbar-icons/" data-url="http://bit.ly/teqbRo" data-text="wxPython 101: Creating Taskbar Icons" data-count="vertical" data-via="socializeWP" ><!--Tweetter--></a></div><div class="socialize-in-button socialize-in-button-left"><iframe src="http://www.facebook.com/plugins/like.php?href=http://www.blog.pythonlibrary.org/2011/12/13/wxpython-101-creating-taskbar-icons/&amp;layout=button_count&amp;show_faces=true&amp;width=100&amp;action=like&amp;font=arial&amp;colorscheme=light&amp;height=65" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px !important; height:65px;" allowTransparency="true"></iframe></div></div><p>Have you ever wondered how to create those little status icons in the Windows System Tray that usually appear on the lower right of your screen? The wxPython toolkit provides a pretty simple way to do just that and this article will walk you through the process.<span id="more-1997"></span></p>
<h2>Working the Code</h2>
<p>For reasons I don&#8217;t quite understand, the wx component we want is wx.TaskBarIcon. I assume it&#8217;s called that because the System Tray is part of the TaskBar or maybe they don&#8217;t differentiate between the TaskBar and the tray area in other operating systems. Anyway, first you need an icon to use. You can get your image wherever you like. In this example, we&#8217;re going to use an an &#8220;envelope&#8221; image that I turned into Python code using wxPython&#8217;s handy img2py utility. When you run an image through img2py, you&#8217;ll end up with something like this:</p>
<pre class="python"><span style="color: #808080; font-style: italic;">#----------------------------------------------------------------------</span>
<span style="color: #808080; font-style: italic;"># This file was generated by img2py.py</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #ff7700;font-weight:bold;">from</span> wx <span style="color: #ff7700;font-weight:bold;">import</span> ImageFromStream, BitmapFromImage
<span style="color: #ff7700;font-weight:bold;">from</span> wx <span style="color: #ff7700;font-weight:bold;">import</span> EmptyIcon
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">cStringIO</span>, <span style="color: #dc143c;">zlib</span>
&nbsp;
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> getData<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #dc143c;">zlib</span>.<span style="color: black;">decompress</span><span style="color: black;">&#40;</span>
<span style="color: #483d8b;">'x<span style="color: #000099; font-weight: bold;">\x</span>da<span style="color: #000099; font-weight: bold;">\x</span>01<span style="color: #000099; font-weight: bold;">\x</span>86<span style="color: #000099; font-weight: bold;">\x</span>01y<span style="color: #000099; font-weight: bold;">\x</span>fe<span style="color: #000099; font-weight: bold;">\x</span>89PNG<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\x</span>1a<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\x</span>00<span style="color: #000099; font-weight: bold;">\x</span>00<span style="color: #000099; font-weight: bold;">\x</span>00<span style="color: #000099; font-weight: bold;">\r</span>IHDR<span style="color: #000099; font-weight: bold;">\x</span>00<span style="color: #000099; font-weight: bold;">\x</span>00<span style="color: #000099; font-weight: bold;">\x</span>00 <span style="color: #000099; font-weight: bold;">\x</span>00<span style="color: #000099; font-weight: bold;">\</span>
<span style="color: #000099; font-weight: bold;">\x</span>00<span style="color: #000099; font-weight: bold;">\x</span>00 <span style="color: #000099; font-weight: bold;">\x</span>08<span style="color: #000099; font-weight: bold;">\x</span>06<span style="color: #000099; font-weight: bold;">\x</span>00<span style="color: #000099; font-weight: bold;">\x</span>00<span style="color: #000099; font-weight: bold;">\x</span>00szz<span style="color: #000099; font-weight: bold;">\x</span>f4<span style="color: #000099; font-weight: bold;">\x</span>00<span style="color: #000099; font-weight: bold;">\x</span>00<span style="color: #000099; font-weight: bold;">\x</span>00<span style="color: #000099; font-weight: bold;">\x</span>04sBIT<span style="color: #000099; font-weight: bold;">\x</span>08<span style="color: #000099; font-weight: bold;">\x</span>08<span style="color: #000099; font-weight: bold;">\x</span>08<span style="color: #000099; font-weight: bold;">\x</span>08|<span style="color: #000099; font-weight: bold;">\</span>
<span style="color: #000099; font-weight: bold;">\x</span>08d<span style="color: #000099; font-weight: bold;">\x</span>88<span style="color: #000099; font-weight: bold;">\x</span>00<span style="color: #000099; font-weight: bold;">\x</span>00<span style="color: #000099; font-weight: bold;">\x</span>01=IDATX<span style="color: #000099; font-weight: bold;">\x</span>85<span style="color: #000099; font-weight: bold;">\x</span>ed<span style="color: #000099; font-weight: bold;">\x</span>97[<span style="color: #000099; font-weight: bold;">\x</span>9a<span style="color: #000099; font-weight: bold;">\x</span>83 <span style="color: #000099; font-weight: bold;">\x</span>0c<span style="color: #000099; font-weight: bold;">\x</span>85Ol<span style="color: #000099; font-weight: bold;">\x</span>f7<span style="color: #000099; font-weight: bold;">\x</span>1566#<span style="color: #000099; font-weight: bold;">\x</span>ec<span style="color: #000099; font-weight: bold;">\</span>
<span style="color: #000099; font-weight: bold;">\x</span>ac,<span style="color: #000099; font-weight: bold;">\x</span>ace<span style="color: #000099; font-weight: bold;">\x</span>1e<span style="color: #000099; font-weight: bold;">\x</span>e4b <span style="color: #000099; font-weight: bold;">\x</span>fa<span style="color: #000099; font-weight: bold;">\x</span>a9<span style="color: #000099; font-weight: bold;">\x</span>a3<span style="color: #000099; font-weight: bold;">\x</span>e5<span style="color: #000099; font-weight: bold;">\x</span>c5&lt;<span style="color: #000099; font-weight: bold;">\x</span>15$9<span style="color: #000099; font-weight: bold;">\x</span>7fO<span style="color: #000099; font-weight: bold;">\x</span>c0<span style="color: #000099; font-weight: bold;">\x</span>0b<span style="color: #000099; font-weight: bold;">\x</span>d1<span style="color: #000099; font-weight: bold;">\x</span>f0@<span style="color: #000099; font-weight: bold;">\x</span>cf<span style="color: #000099; font-weight: bold;">\</span>
<span style="color: #000099; font-weight: bold;">\x</span>18<span style="color: #000099; font-weight: bold;">\x</span>ba<span style="color: #000099; font-weight: bold;">\x</span>aa<span style="color: #000099; font-weight: bold;">\x</span>df<span style="color: #000099; font-weight: bold;">\x</span>007<span style="color: #000099; font-weight: bold;">\x</span>00<span style="color: #000099; font-weight: bold;">\x</span>80g<span style="color: #000099; font-weight: bold;">\x</span>fa1<span style="color: #000099; font-weight: bold;">\x</span>fe<span style="color: #000099; font-weight: bold;">\x</span>fe<span style="color: #000099; font-weight: bold;">\x</span>84o<span style="color: #000099; font-weight: bold;">\x</span>89ZkA<span style="color: #000099; font-weight: bold;">\x</span>c3<span style="color: #000099; font-weight: bold;">\x</span>83<span style="color: #000099; font-weight: bold;">\x</span>04<span style="color: #000099; font-weight: bold;">\x</span>00<span style="color: #000099; font-weight: bold;">\x</span>00<span style="color: #000099; font-weight: bold;">\</span>
<span style="color: #000099; font-weight: bold;">\x</span>8c<span style="color: #000099; font-weight: bold;">\x</span>e3x<span style="color: #000099; font-weight: bold;">\x</span>a1,<span style="color: #000099; font-weight: bold;">\x</span>01<span style="color: #000099; font-weight: bold;">\x</span>08p<span style="color: #000099; font-weight: bold;">\x</span>ce<span style="color: #000099; font-weight: bold;">\x</span>89Y<span style="color: #000099; font-weight: bold;">\x</span>d1<span style="color: #000099; font-weight: bold;">\x</span>82<span style="color: #000099; font-weight: bold;">\x</span>fa<span style="color: #000099; font-weight: bold;">\x</span>e2y<span style="color: #000099; font-weight: bold;">\x</span>c2P<span style="color: #000099; font-weight: bold;">\x</span>c5<span style="color: #000099; font-weight: bold;">\x</span>1b<span style="color: #000099; font-weight: bold;">\x</span>00c<span style="color: #000099; font-weight: bold;">\x</span>cc<span style="color: #000099; font-weight: bold;">\x</span>05<span style="color: #000099; font-weight: bold;">\</span>
<span style="color: #000099; font-weight: bold;">\x</span>10Sg<span style="color: #000099; font-weight: bold;">\x</span>9ds0<span style="color: #000099; font-weight: bold;">\x</span>c6<span style="color: #000099; font-weight: bold;">\x</span>ac<span style="color: #000099; font-weight: bold;">\x</span>030<span style="color: #000099; font-weight: bold;">\x</span>f3<span style="color: #000099; font-weight: bold;">\x</span>05<span style="color: #000099; font-weight: bold;">\x</span>10<span style="color: #000099; font-weight: bold;">\x</span>94<span style="color: #000099; font-weight: bold;">\x</span>c5<span style="color: #000099; font-weight: bold;">\x</span>99y<span style="color: #000099; font-weight: bold;">\x</span>1d<span style="color: #000099; font-weight: bold;">\x</span>e0<span style="color: #000099; font-weight: bold;">\\</span><span style="color: #000099; font-weight: bold;">\x</span>88<span style="color: #000099; font-weight: bold;">\x</span>c9z<span style="color: #000099; font-weight: bold;">\x</span>e7l<span style="color: #000099; font-weight: bold;">\</span>
<span style="color: #000099; font-weight: bold;">\x</span>147<span style="color: #000099; font-weight: bold;">\x</span>ea*<span style="color: #000099; font-weight: bold;">\x</span>f5<span style="color: #000099; font-weight: bold;">\x</span>18<span style="color: #000099; font-weight: bold;">\x</span>fe<span style="color: #000099; font-weight: bold;">\x</span>0fB<span style="color: #000099; font-weight: bold;">\x</span>f6<span style="color: #000099; font-weight: bold;">\x</span>bc<span style="color: #000099; font-weight: bold;">\x</span>fcs<span style="color: #000099; font-weight: bold;">\x</span>fd<span style="color: #000099; font-weight: bold;">\x</span>90-<span style="color: #000099; font-weight: bold;">\x</span>de<span style="color: #000099; font-weight: bold;">\x</span>07<span style="color: #000099; font-weight: bold;">\x</span>8eC<span style="color: #000099; font-weight: bold;">\x</span>c8<span style="color: #000099; font-weight: bold;">\x</span>9e<span style="color: #000099; font-weight: bold;">\x</span>17<span style="color: #000099; font-weight: bold;">\</span>
<span style="color: #000099; font-weight: bold;">\x</span>dbI]<span style="color: #000099; font-weight: bold;">\x</span>bdz#:<span style="color: #000099; font-weight: bold;">\x</span>06Q<span style="color: #000099; font-weight: bold;">\x</span>f7<span style="color: #000099; font-weight: bold;">\x</span>bc8<span style="color: #000099; font-weight: bold;">\x</span>b2<span style="color: #000099; font-weight: bold;">\x</span>1b`<span style="color: #000099; font-weight: bold;">\x</span>1f<span style="color: #000099; font-weight: bold;">\x</span>c4R<span style="color: #000099; font-weight: bold;">\x</span>cf<span style="color: #000099; font-weight: bold;">\x</span>83<span style="color: #000099; font-weight: bold;">\x</span>b8<span style="color: #000099; font-weight: bold;">\x</span>be<span style="color: #000099; font-weight: bold;">\x</span>1b %<span style="color: #000099; font-weight: bold;">\x</span>16<span style="color: #000099; font-weight: bold;">\x</span>08<span style="color: #000099; font-weight: bold;">\</span>
<span style="color: #000099; font-weight: bold;">\x</span>12<span style="color: #000099; font-weight: bold;">\x</span>f3Z<span style="color: #000099; font-weight: bold;">\x</span>cfu<span style="color: #000099; font-weight: bold;">\x</span>e1<span style="color: #000099; font-weight: bold;">\x</span>dd<span style="color: #000099; font-weight: bold;">\x</span>0eL<span style="color: #000099; font-weight: bold;">\x</span>89<span style="color: #000099; font-weight: bold;">\x</span>de<span style="color: #000099; font-weight: bold;">\x</span>bf<span style="color: #000099; font-weight: bold;">\x</span>c0<span style="color: #000099; font-weight: bold;">\x</span>cc3<span style="color: #000099; font-weight: bold;">\'</span>lU<span style="color: #000099; font-weight: bold;">\x</span>b0=<span style="color: #000099; font-weight: bold;">\x</span>e7<span style="color: #000099; font-weight: bold;">\x</span>cc<span style="color: #000099; font-weight: bold;">\x</span>0c<span style="color: #000099; font-weight: bold;">\x</span>ef<span style="color: #000099; font-weight: bold;">\</span>
<span style="color: #000099; font-weight: bold;">\x</span>fd<span style="color: #000099; font-weight: bold;">\x</span>02<span style="color: #000099; font-weight: bold;">\x</span>88<span style="color: #000099; font-weight: bold;">\x</span>8c<span style="color: #000099; font-weight: bold;">\x</span>a7:<span style="color: #000099; font-weight: bold;">\x</span>1b<span style="color: #000099; font-weight: bold;">\x</span>13<span style="color: #000099; font-weight: bold;">\x</span>bd<span style="color: #000099; font-weight: bold;">\x</span>f7<span style="color: #000099; font-weight: bold;">\x</span>d1<span style="color: #000099; font-weight: bold;">\x</span>ca<span style="color: #000099; font-weight: bold;">\x</span>90<span style="color: #000099; font-weight: bold;">\x</span>0b<span style="color: #000099; font-weight: bold;">\'</span><span style="color: #000099; font-weight: bold;">\x</span>b1:<span style="color: #000099; font-weight: bold;">\x</span>8a<span style="color: #000099; font-weight: bold;">\x</span>f8<span style="color: #000099; font-weight: bold;">\x</span>b4&gt;A<span style="color: #000099; font-weight: bold;">\</span>
<span style="color: #000099; font-weight: bold;">\x</span>94|<span style="color: #000099; font-weight: bold;">\x</span>dd<span style="color: #000099; font-weight: bold;">\x</span>81E<span style="color: #000099; font-weight: bold;">\x</span>80)y~|(<span style="color: #000099; font-weight: bold;">\x</span>17<span style="color: #000099; font-weight: bold;">\x</span>d6<span style="color: #000099; font-weight: bold;">\x</span>a2<span style="color: #000099; font-weight: bold;">\x</span>15&quot;0<span style="color: #000099; font-weight: bold;">\x</span>87<span style="color: #000099; font-weight: bold;">\x</span>e8`<span style="color: #000099; font-weight: bold;">\x</span>c9<span style="color: #000099; font-weight: bold;">\x</span>df<span style="color: #000099; font-weight: bold;">\x</span>00@<span style="color: #000099; font-weight: bold;">\x</span>d9v<span style="color: #000099; font-weight: bold;">\x</span>19<span style="color: #000099; font-weight: bold;">\x</span>b2<span style="color: #000099; font-weight: bold;">\</span>
<span style="color: #000099; font-weight: bold;">\x</span>f0|}-&lt;<span style="color: #000099; font-weight: bold;">\x</span>1f3<span style="color: #000099; font-weight: bold;">\x</span>9bXo<span style="color: #000099; font-weight: bold;">\x</span>e3<span style="color: #000099; font-weight: bold;">\x</span>1e(<span style="color: #000099; font-weight: bold;">\x</span>e2u<span style="color: #000099; font-weight: bold;">\x</span>cf<span style="color: #000099; font-weight: bold;">\x</span>ea<span style="color: #000099; font-weight: bold;">\x</span>cd<span style="color: #000099; font-weight: bold;">\x</span>b4},<span style="color: #000099; font-weight: bold;">\x</span>f7<span style="color: #000099; font-weight: bold;">\x</span>c4<span style="color: #000099; font-weight: bold;">\n</span>@<span style="color: #000099; font-weight: bold;">\x</span>b1<span style="color: #000099; font-weight: bold;">\x</span>fd<span style="color: #000099; font-weight: bold;">\x</span>98<span style="color: #000099; font-weight: bold;">\</span>
<span style="color: #000099; font-weight: bold;">\x</span>d0<span style="color: #000099; font-weight: bold;">\x</span>dax<span style="color: #000099; font-weight: bold;">\t</span><span style="color: #000099; font-weight: bold;">\x</span>a2y<span style="color: #000099; font-weight: bold;">\x</span>18<span style="color: #000099; font-weight: bold;">\x</span>b5q<span style="color: #000099; font-weight: bold;">\x</span>1e<span style="color: #000099; font-weight: bold;">\x</span>c8<span style="color: #000099; font-weight: bold;">\x</span>a6<span style="color: #000099; font-weight: bold;">\x</span>87<span style="color: #000099; font-weight: bold;">\x</span>d1<span style="color: #000099; font-weight: bold;">\x</span>99<span style="color: #000099; font-weight: bold;">\x</span>d6<span style="color: #000099; font-weight: bold;">\x</span>eb<span style="color: #000099; font-weight: bold;">\x</span>e3<span style="color: #000099; font-weight: bold;">\x</span>aaz<span style="color: #000099; font-weight: bold;">\x</span>fa0<span style="color: #000099; font-weight: bold;">\x</span>e9<span style="color: #000099; font-weight: bold;">\</span>
<span style="color: #000099; font-weight: bold;">\x</span>f5J<span style="color: #000099; font-weight: bold;">\x</span>96<span style="color: #000099; font-weight: bold;">\x</span>01<span style="color: #000099; font-weight: bold;">\x</span>c2<span style="color: #000099; font-weight: bold;">\x</span>e7<span style="color: #000099; font-weight: bold;">\x</span>fd5<span style="color: #000099; font-weight: bold;">\x</span>00<span style="color: #000099; font-weight: bold;">\x</span>00-@<span style="color: #000099; font-weight: bold;">\x</span>af<span style="color: #000099; font-weight: bold;">\x</span>e8<span style="color: #000099; font-weight: bold;">\x</span>feZ~<span style="color: #000099; font-weight: bold;">\x</span>03t<span style="color: #000099; font-weight: bold;">\x</span>07<span style="color: #000099; font-weight: bold;">\x</span>f8<span style="color: #000099; font-weight: bold;">\x</span>03<span style="color: #000099; font-weight: bold;">\x</span>82<span style="color: #000099; font-weight: bold;">\x</span>ac<span style="color: #000099; font-weight: bold;">\</span>
<span style="color: #000099; font-weight: bold;">\x</span>a4VT<span style="color: #000099; font-weight: bold;">\x</span>fd<span style="color: #000099; font-weight: bold;">\x</span>cd<span style="color: #000099; font-weight: bold;">\x</span>a3<span style="color: #000099; font-weight: bold;">\x</span>00<span style="color: #000099; font-weight: bold;">\x</span>00<span style="color: #000099; font-weight: bold;">\x</span>00<span style="color: #000099; font-weight: bold;">\x</span>00IEND<span style="color: #000099; font-weight: bold;">\x</span>aeB`<span style="color: #000099; font-weight: bold;">\x</span>82<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\x</span>a7<span style="color: #000099; font-weight: bold;">\x</span>a9<span style="color: #000099; font-weight: bold;">\x</span>a8'</span> <span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> getBitmap<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">return</span> BitmapFromImage<span style="color: black;">&#40;</span>getImage<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> getImage<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
    stream = <span style="color: #dc143c;">cStringIO</span>.<span style="color: #dc143c;">StringIO</span><span style="color: black;">&#40;</span>getData<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">return</span> ImageFromStream<span style="color: black;">&#40;</span>stream<span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> getIcon<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
    icon = EmptyIcon<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
    icon.<span style="color: black;">CopyFromBitmap</span><span style="color: black;">&#40;</span>getBitmap<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">return</span> icon</pre>
<p>The image data is all in the <strong>getData</strong> function. I am going to call this file &#8220;email_ico.py&#8221;. We&#8217;ll import it into our main program and call its <strong>getIcon</strong> method to acquire the icon we want to use. Let&#8217;s take a look at the main application now:</p>
<pre class="python"><span style="color: #ff7700;font-weight:bold;">import</span> wx
<span style="color: #ff7700;font-weight:bold;">from</span> mail_ico <span style="color: #ff7700;font-weight:bold;">import</span> getIcon
&nbsp;
<span style="color: #808080; font-style: italic;">########################################################################</span>
<span style="color: #ff7700;font-weight:bold;">class</span> MailIcon<span style="color: black;">&#40;</span>wx.<span style="color: black;">TaskBarIcon</span><span style="color: black;">&#41;</span>:
    TBMENU_RESTORE = wx.<span style="color: black;">NewId</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
    TBMENU_CLOSE   = wx.<span style="color: black;">NewId</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
    TBMENU_CHANGE  = wx.<span style="color: black;">NewId</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
    TBMENU_REMOVE  = wx.<span style="color: black;">NewId</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #808080; font-style: italic;">#----------------------------------------------------------------------</span>
    <span style="color: #ff7700;font-weight:bold;">def</span> <span style="color: #0000cd;">__init__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, frame<span style="color: black;">&#41;</span>:
        wx.<span style="color: black;">TaskBarIcon</span>.<span style="color: #0000cd;">__init__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">frame</span> = frame
&nbsp;
        <span style="color: #808080; font-style: italic;"># Set the image</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">tbIcon</span> = getIcon<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
        <span style="color: #008000;">self</span>.<span style="color: black;">SetIcon</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: black;">tbIcon</span>, <span style="color: #483d8b;">&quot;Test&quot;</span><span style="color: black;">&#41;</span>
&nbsp;
        <span style="color: #808080; font-style: italic;"># bind some events</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">Bind</span><span style="color: black;">&#40;</span>wx.<span style="color: black;">EVT_MENU</span>, <span style="color: #008000;">self</span>.<span style="color: black;">OnTaskBarClose</span>, <span style="color: #008000;">id</span>=<span style="color: #008000;">self</span>.<span style="color: black;">TBMENU_CLOSE</span><span style="color: black;">&#41;</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">Bind</span><span style="color: black;">&#40;</span>wx.<span style="color: black;">EVT_TASKBAR_LEFT_DOWN</span>, <span style="color: #008000;">self</span>.<span style="color: black;">OnTaskBarLeftClick</span><span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #808080; font-style: italic;">#----------------------------------------------------------------------</span>
    <span style="color: #ff7700;font-weight:bold;">def</span> CreatePopupMenu<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, evt=<span style="color: #008000;">None</span><span style="color: black;">&#41;</span>:
        <span style="color: #483d8b;">&quot;&quot;</span><span style="color: #483d8b;">&quot;
        This method is called by the base class when it needs to popup
        the menu for the default EVT_RIGHT_DOWN event.  Just create
        the menu how you want it and return it from this function,
        the base class takes care of the rest.
        &quot;</span><span style="color: #483d8b;">&quot;&quot;</span>
        menu = wx.<span style="color: black;">Menu</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        menu.<span style="color: black;">Append</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: black;">TBMENU_RESTORE</span>, <span style="color: #483d8b;">&quot;Open Program&quot;</span><span style="color: black;">&#41;</span>
        menu.<span style="color: black;">Append</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: black;">TBMENU_CHANGE</span>, <span style="color: #483d8b;">&quot;Show all the Items&quot;</span><span style="color: black;">&#41;</span>
        menu.<span style="color: black;">AppendSeparator</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        menu.<span style="color: black;">Append</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: black;">TBMENU_CLOSE</span>,   <span style="color: #483d8b;">&quot;Exit Program&quot;</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">return</span> menu
&nbsp;
    <span style="color: #808080; font-style: italic;">#----------------------------------------------------------------------</span>
    <span style="color: #ff7700;font-weight:bold;">def</span> OnTaskBarActivate<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, evt<span style="color: black;">&#41;</span>:
        <span style="color: #483d8b;">&quot;&quot;</span><span style="color: #483d8b;">&quot;&quot;</span><span style="color: #483d8b;">&quot;&quot;</span>
        <span style="color: #ff7700;font-weight:bold;">pass</span>
&nbsp;
    <span style="color: #808080; font-style: italic;">#----------------------------------------------------------------------</span>
    <span style="color: #ff7700;font-weight:bold;">def</span> OnTaskBarClose<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, evt<span style="color: black;">&#41;</span>:
        <span style="color: #483d8b;">&quot;&quot;</span><span style="color: #483d8b;">&quot;
        Destroy the taskbar icon and frame from the taskbar icon itself
        &quot;</span><span style="color: #483d8b;">&quot;&quot;</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">frame</span>.<span style="color: black;">Close</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #808080; font-style: italic;">#----------------------------------------------------------------------</span>
    <span style="color: #ff7700;font-weight:bold;">def</span> OnTaskBarLeftClick<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, evt<span style="color: black;">&#41;</span>:
        <span style="color: #483d8b;">&quot;&quot;</span><span style="color: #483d8b;">&quot;
        Create the right-click menu
        &quot;</span><span style="color: #483d8b;">&quot;&quot;</span>
        menu = <span style="color: #008000;">self</span>.<span style="color: black;">tbIcon</span>.<span style="color: black;">CreatePopupMenu</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">PopupMenu</span><span style="color: black;">&#40;</span>menu<span style="color: black;">&#41;</span>
        menu.<span style="color: black;">Destroy</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">########################################################################</span>
<span style="color: #ff7700;font-weight:bold;">class</span> MyForm<span style="color: black;">&#40;</span>wx.<span style="color: black;">Frame</span><span style="color: black;">&#41;</span>:
&nbsp;
    <span style="color: #808080; font-style: italic;">#----------------------------------------------------------------------</span>
    <span style="color: #ff7700;font-weight:bold;">def</span> <span style="color: #0000cd;">__init__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:
        wx.<span style="color: black;">Frame</span>.<span style="color: #0000cd;">__init__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, <span style="color: #008000;">None</span>, wx.<span style="color: black;">ID_ANY</span>, <span style="color: #483d8b;">&quot;Tutorial&quot;</span>, size=<span style="color: black;">&#40;</span><span style="color: #ff4500;">500</span>,<span style="color: #ff4500;">500</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
        panel = wx.<span style="color: black;">Panel</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">tbIcon</span> = MailIcon<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">Bind</span><span style="color: black;">&#40;</span>wx.<span style="color: black;">EVT_CLOSE</span>, <span style="color: #008000;">self</span>.<span style="color: black;">onClose</span><span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #808080; font-style: italic;">#----------------------------------------------------------------------</span>
    <span style="color: #ff7700;font-weight:bold;">def</span> onClose<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, evt<span style="color: black;">&#41;</span>:
        <span style="color: #483d8b;">&quot;&quot;</span><span style="color: #483d8b;">&quot;
        Destroy the taskbar icon and the frame
        &quot;</span><span style="color: #483d8b;">&quot;&quot;</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">tbIcon</span>.<span style="color: black;">RemoveIcon</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">tbIcon</span>.<span style="color: black;">Destroy</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">Destroy</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">#----------------------------------------------------------------------</span>
<span style="color: #808080; font-style: italic;"># Run the program</span>
<span style="color: #ff7700;font-weight:bold;">if</span> __name__ == <span style="color: #483d8b;">&quot;__main__&quot;</span>:
    app = wx.<span style="color: black;">App</span><span style="color: black;">&#40;</span><span style="color: #008000;">False</span><span style="color: black;">&#41;</span>
    frame = MyForm<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>.<span style="color: black;">Show</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
    app.<span style="color: black;">MainLoop</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre>
<p>The first class is basically copied straight out of the wxPython demo and simplified slightly. You can look there if you need a more complete example. Anyway, we bind a couple events in our sub-classed TaskBarIcon that allow us to close the application and show a menu, respectively. You will also note that we set the icon we created in the <strong>__init__</strong> simply by calling its <strong>SetIcon</strong> method and passing in a string for its tooltip.</p>
<p>In the close method, we call the frame directly that we want it to close. A better method would be to use pubsub here. If you want to pause a moment and read about pubsub, I&#8217;ve written a little <a href="http://www.blog.pythonlibrary.org/2010/06/27/wxpython-and-pubsub-a-simple-tutorial/" target="_blank">post </a>about it too. The rest of the code is pretty self-explanatory.</p>
<p>Now we can move on to the wx.Frame sub-class. Here we basically just instantiate the TaskBarIcon class that we created earlier and we bind the frame to <strong>EVT_CLOSE</strong>. You might wonder about this. There are some got&#8217;chas with using the TaskBarIcon on Windows. If I just tell the frame to close, it closes just fine, but the icon remains and Python just kind of hangs in lala land. If you only allow the user to close using the task bar icon&#8217;s right-click menu, then you could just add a <strong>RemoveIcon</strong> method and a self.Destroy() there and you&#8217;d be good to go (for some reason, RemoveIcon isn&#8217;t enough to get rid of the TaskBarIcon, so you also need to tell it to Destroy itself too) But if you allow the user to press the little &#8220;x&#8221; in the upper right-hand corner, then you&#8217;ll need to catch <strong>EVT_CLOSE</strong> and deal with it appropriately. When you do catch this event, you can NOT just call <strong>self.Close()</strong> or you&#8217;ll end up in an infinite loop, which is why we call <strong>self.Destroy()</strong> instead. </p>
<h2>Wrapping Up</h2>
<p>Now you should be able to create your own TaskBarIcon application. I highly recommend looking at the wxPython demo to see what else you can do with it. I think adding an icon can add a bit of polish to your application, especially if you need to have it running hidden for a while and then make it pop-up at the user&#8217;s command.</p>
<h2>Further Reading</h2>
<ul>
<li><a href="http://wiki.wxpython.org/FlashingTaskbarIcon" target="_blank">Create a Flashing TaskBarIcon</a></li>
<li><a href="http://www.techniqal.com/blog/2005/07/20/creating-a-task-bar-icon-in-wxpython/" target="_blank">Another blog&#8217;s</a> take on this subject</li>
<li>The TaskBarIcon <a href="http://www.wxpython.org/docs/api/wx.TaskBarIcon-class.html" target="_blank">documentation</a></li>
</ul>
<h2>Source</h2>
<ul>
<li><a href='http://www.blog.pythonlibrary.org/wp-content/uploads/2011/12/TBI_src.tar'>TBI_src.tar</a></li>
<li><a href='http://www.blog.pythonlibrary.org/wp-content/uploads/2011/12/TBI_src.zip'>TBI_src.zip</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.pythonlibrary.org/2011/12/13/wxpython-101-creating-taskbar-icons/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>PyCon USA Registration is Open and Tutorials Are Up</title>
		<link>http://www.blog.pythonlibrary.org/2011/12/12/pycon-usa-registration-is-open-and-tutorials-are-up/</link>
		<comments>http://www.blog.pythonlibrary.org/2011/12/12/pycon-usa-registration-is-open-and-tutorials-are-up/#comments</comments>
		<pubDate>Tue, 13 Dec 2011 02:26:26 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Advocacy]]></category>
		<category><![CDATA[PyCon]]></category>
		<category><![CDATA[PyCon 2012]]></category>

		<guid isPermaLink="false">http://www.blog.pythonlibrary.org/?p=2133</guid>
		<description><![CDATA[The 2012 Python Conference USA opened Registration today. The official announcement doesn&#8217;t mention it, but I&#8217;m pretty sure there&#8217;s an attendance cap on this conference too of 1500 just like last year. You should sign up early not only because of the limited attendance, but because there are &#8220;Early Bird&#8221; rates which are cheaper! The [...]]]></description>
			<content:encoded><![CDATA[<div class="socialize-in-content" style="float:left;"><div class="socialize-in-button socialize-in-button-left"><a href="http://twitter.com/share" class="twitter-share-button" data-counturl="http://www.blog.pythonlibrary.org/2011/12/12/pycon-usa-registration-is-open-and-tutorials-are-up/" data-url="http://bit.ly/uVXzpi" data-text="PyCon USA Registration is Open and Tutorials Are Up" data-count="vertical" data-via="socializeWP" ><!--Tweetter--></a></div><div class="socialize-in-button socialize-in-button-left"><iframe src="http://www.facebook.com/plugins/like.php?href=http://www.blog.pythonlibrary.org/2011/12/12/pycon-usa-registration-is-open-and-tutorials-are-up/&amp;layout=button_count&amp;show_faces=true&amp;width=100&amp;action=like&amp;font=arial&amp;colorscheme=light&amp;height=65" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px !important; height:65px;" allowTransparency="true"></iframe></div><div class="socialize-in-button socialize-in-button-left"><script type="text/javascript">
			<!-- 
			reddit_url = "http://www.blog.pythonlibrary.org/2011/12/12/pycon-usa-registration-is-open-and-tutorials-are-up/";
			reddit_title = "PyCon USA Registration is Open and Tutorials Are Up";	//-->
		</script><script type="text/javascript" src="http://www.reddit.com/static/button/button2.js"></script></div><div class="socialize-in-button socialize-in-button-left"><g:plusone size="small" href="http://www.blog.pythonlibrary.org/2011/12/12/pycon-usa-registration-is-open-and-tutorials-are-up/"></g:plusone></div></div><p>The 2012 Python Conference USA opened Registration today. The <a href="http://pycon.blogspot.com/2011/12/registration-for-pycon-2012-opened.html" target="_blank">official announcement</a> doesn&#8217;t mention it, but I&#8217;m pretty sure there&#8217;s an attendance cap on this conference too of 1500 just like last year. You should sign up early not only because of the limited attendance, but because there are &#8220;Early Bird&#8221; rates which are cheaper!</p>
<p>The complete schedule isn&#8217;t done yet, but you can whet your appetite by checking out the <a href="http://pycon.blogspot.com/2011/12/announcing-pycon-2012-tutorials.html" target="_blank">list of tutorials</a> that were released last week. </p>
<p>I have enjoyed all the PyCons I&#8217;ve attended so far. They are a great place to learn new things, show others your talent, network with like-minded people and just relax too. This year, the conference will be in Santa Clara, California. If you can&#8217;t afford to go, they even offer Financial Assistance. So why are you waiting? </p>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.pythonlibrary.org/2011/12/12/pycon-usa-registration-is-open-and-tutorials-are-up/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python Voted Best Programming Language 3 Years Running</title>
		<link>http://www.blog.pythonlibrary.org/2011/12/07/python-voted-best-programming-language-3-years-running/</link>
		<comments>http://www.blog.pythonlibrary.org/2011/12/07/python-voted-best-programming-language-3-years-running/#comments</comments>
		<pubDate>Wed, 07 Dec 2011 18:49:43 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Advocacy]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.blog.pythonlibrary.org/?p=2108</guid>
		<description><![CDATA[The Linux Journal readers have good taste. This is the 3rd year that they have voted Python as the Best Programming Language. Oddly enough, C++ is the runner-up. I personally liked C++ when I was in school, but the two languages are quite different. On the other hand, Python interfaces with C/C++ pretty well, so [...]]]></description>
			<content:encoded><![CDATA[<div class="socialize-in-content" style="float:left;"><div class="socialize-in-button socialize-in-button-left"><a href="http://twitter.com/share" class="twitter-share-button" data-counturl="http://www.blog.pythonlibrary.org/2011/12/07/python-voted-best-programming-language-3-years-running/" data-url="http://bit.ly/vBds2S" data-text="Python Voted Best Programming Language 3 Years Running" data-count="vertical" data-via="socializeWP" ><!--Tweetter--></a></div><div class="socialize-in-button socialize-in-button-left"><iframe src="http://www.facebook.com/plugins/like.php?href=http://www.blog.pythonlibrary.org/2011/12/07/python-voted-best-programming-language-3-years-running/&amp;layout=button_count&amp;show_faces=true&amp;width=100&amp;action=like&amp;font=arial&amp;colorscheme=light&amp;height=65" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px !important; height:65px;" allowTransparency="true"></iframe></div><div class="socialize-in-button socialize-in-button-left"><script type="text/javascript">
			<!-- 
			reddit_url = "http://www.blog.pythonlibrary.org/2011/12/07/python-voted-best-programming-language-3-years-running/";
			reddit_title = "Python Voted Best Programming Language 3 Years Running";	//-->
		</script><script type="text/javascript" src="http://www.reddit.com/static/button/button2.js"></script></div><div class="socialize-in-button socialize-in-button-left"><g:plusone size="small" href="http://www.blog.pythonlibrary.org/2011/12/07/python-voted-best-programming-language-3-years-running/"></g:plusone></div></div><p>The <a href="http://www.linuxjournal.com/slideshow/readers-choice-2011?page=27" target="_blank">Linux Journal</a> readers have good taste. This is the 3rd year that they have voted Python as the <strong>Best Programming Language</strong>. Oddly enough, C++ is the runner-up. I personally liked C++ when I was in school, but the two languages are quite different. On the other hand, Python interfaces with C/C++ pretty well, so maybe the readers of that magazine like to do mash-ups with the two languages. You will also note that they voted Python as the <a href="http://www.linuxjournal.com/slideshow/readers-choice-2011?page=28" target="_blank">Best Scripting Language</a> too.</p>
<p>Congrats to the Python community and the PSF too!</p>
<p>Hat-tip to <a href="http://holdenweb.com/" target="_blank">Steve Holden</a> who mentioned this on Python.org&#8217;s <a href="http://www.python.org/news/index.html#Wed7December20111010-0800" target="_blank">news feed</a>. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.pythonlibrary.org/2011/12/07/python-voted-best-programming-language-3-years-running/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Python 101: Setting up Python on Windows</title>
		<link>http://www.blog.pythonlibrary.org/2011/11/24/python-101-setting-up-python-on-windows/</link>
		<comments>http://www.blog.pythonlibrary.org/2011/11/24/python-101-setting-up-python-on-windows/#comments</comments>
		<pubDate>Thu, 24 Nov 2011 15:32:38 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[PyWin32]]></category>

		<guid isPermaLink="false">http://www.blog.pythonlibrary.org/?p=2052</guid>
		<description><![CDATA[Python is pretty easy to install on Windows, but sometimes you need to do a few extra tweaks to really get the most our your development environment. In this article, we will try to cover all the common things you might want to do or install to get an ideal Python Windows development workspace set [...]]]></description>
			<content:encoded><![CDATA[<div class="socialize-in-content" style="float:left;"><div class="socialize-in-button socialize-in-button-left"><a href="http://twitter.com/share" class="twitter-share-button" data-counturl="http://www.blog.pythonlibrary.org/2011/11/24/python-101-setting-up-python-on-windows/" data-url="http://bit.ly/tTCkmJ" data-text="Python 101: Setting up Python on Windows" data-count="vertical" data-via="socializeWP" ><!--Tweetter--></a></div><div class="socialize-in-button socialize-in-button-left"><iframe src="http://www.facebook.com/plugins/like.php?href=http://www.blog.pythonlibrary.org/2011/11/24/python-101-setting-up-python-on-windows/&amp;layout=button_count&amp;show_faces=true&amp;width=100&amp;action=like&amp;font=arial&amp;colorscheme=light&amp;height=65" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px !important; height:65px;" allowTransparency="true"></iframe></div><div class="socialize-in-button socialize-in-button-left"><script type="text/javascript">
			<!-- 
			reddit_url = "http://www.blog.pythonlibrary.org/2011/11/24/python-101-setting-up-python-on-windows/";
			reddit_title = "Python 101: Setting up Python on Windows";	//-->
		</script><script type="text/javascript" src="http://www.reddit.com/static/button/button2.js"></script></div><div class="socialize-in-button socialize-in-button-left"><g:plusone size="small" href="http://www.blog.pythonlibrary.org/2011/11/24/python-101-setting-up-python-on-windows/"></g:plusone></div></div><p>Python is pretty easy to install on Windows, but sometimes you need to do a few extra tweaks to really get the most our your development environment. In this article, we will try to cover all the common things you might want to do or install to get an ideal Python Windows development workspace set up. Some of you might think that all you need to do is install Python and you&#8217;re done, but if you&#8217;re going to do Windows development, then you&#8217;ll need a few other packages to make it nicer.<span id="more-2052"></span></p>
<h2>Installing and Configuring Python</h2>
<p>Download <a href="http://www.python.org" target="_blank">Python</a> and run the installer. Make sure you got the version you want (i.e. Python 2.7 or 3.x). You&#8217;ll also want to make sure you get the bit type you want as there&#8217;s a 32-bit and a 64-bit version. <em>Note: The 32-bit Python will run just fine on a 64-bit system, but not vice versa!</em> Once you&#8217;ve got that installed, we&#8217;ll move on.</p>
<p>Now we’re going to make sure Python is set up right. Open a command window by going to Start –> Run and then typing “cmd” and pressing <strong>enter </strong>or <strong>return</strong>. Try typing “python” (without the quotes) in there and hitting your enter key. If you see the Python shell, then we’re halfway there. It should look something like this:</p>
<p><a href="http://www.blog.pythonlibrary.org/wp-content/uploads/2011/11/python_shell.png"><img src="http://www.blog.pythonlibrary.org/wp-content/uploads/2011/11/python_shell-300x148.png" alt="" title="python_shell" width="300" height="148" class="aligncenter size-medium wp-image-2069" /></a></p>
<p>If you don’t, then we need to modify some settings.</p>
<h3>Modifying Your Path</h3>
<p>On Windows, it can help a LOT to modify your Path settings by adding your Python path and the path to the Scripts folder to your System Path. Here&#8217;s one way that you can do it:</p>
<ol>
<li>Right-Click &#8220;My Computer&#8221; and choose <strong>Properties </strong>(Windows XP) or you may have to go digging in Control Panel on Windows 7 and do a &#8220;Show All Control Panel Items&#8221; from the path bar and look for <strong>System</strong>. You should see something like this:
<p><a href="http://www.blog.pythonlibrary.org/wp-content/uploads/2011/08/system_properties_xp.png"><img src="http://www.blog.pythonlibrary.org/wp-content/uploads/2011/08/system_properties_xp.png" alt="" title="system_properties_xp" width="419" height="479" class="aligncenter size-full wp-image-1891" /></a></p>
</li>
<li>Go to the <strong>Advanced</strong> tab and press the <strong>Environmental Variable</strong> button to see something like the following:
<p><a href="http://www.blog.pythonlibrary.org/wp-content/uploads/2011/08/environment_vars_xp.png"><img src="http://www.blog.pythonlibrary.org/wp-content/uploads/2011/08/environment_vars_xp.png" alt="" title="environment_vars_xp" width="384" height="423" class="aligncenter size-full wp-image-1894" /></a>
</li>
<li>You will see two types of variables here. In the bottom section are <strong>System Variables</strong>. Scroll down to the one labeled <strong>Path</strong> and at the end of that, add the following two lines: ;C:\Python26;C:\Python26\Scripts  (adjust as necessary according to your version of Python and its location) Note that each entry is separated by a semi-colon, so make sure you do that too or this will not work!</li>
</ol>
<p>Now you should be able to run Python from the command line. Not only that, you&#8217;ll also be able to run the special scripts that were in Python&#8217;s Scripts folder. Why would you care? Well, if you install easy_install / SetupTools or pip, they will install stuff in the Scripts folder that you can run. Speaking of which, since you now have a brand new installation of Python, let&#8217;s take a moment to show you how to install a 3rd party package.</p>
<h2>How to Install a Package on Windows</h2>
<p>We will use pip as our example. It is used for the easy installation of Python packages from the Python Packages Index (PyPI, not to be confused with PyPy). Anyway, you&#8217;ll need to go <a href="http://pypi.python.org/pypi/pip" target="_blank">here</a> to download it. The pip package is in a tarred and gzipped download at the bottom of the page. You&#8217;ll probably need something like <a href="http://www.izarc.org/" target="_blank">IZArc</a> or <a href="http://www.filzip.com/" target="_blank">Filzip</a> to unzip it since Windows doesn&#8217;t unzip tar files natively.</p>
<p>Open up a command line window as you did before. Now you will need to use the &#8220;cd&#8221; command to change directories to the location that you unzipped the files to. This can take some practice. On my machine, I usually unzip to my desktop and just cd there and then into the unzipped package. Once you&#8217;re in the folder that has the <strong>setup.py</strong> file in it, all you need to do to install it is to type the following:</p>
<p><code><br />
python setup.py install<br />
</code></p>
<p>Most of the time, this works great and the package is installed correctly. Occasionally, you will run into certain packages that complain that they need a compiler. If you don&#8217;t have one installed (like Visual Studio or MingW), then you won&#8217;t be able to install the package this way. You will have to find a pre-packaged installer for it. On my machine, I usually have easy_install installed too. For some reason, the package is called <a href="http://pypi.python.org/pypi/setuptools" target="_blank">SetupTools </a>. Anyway, the main reason that you used to need easy_install was that it was the defacto standard for install Python Eggs, which you can read about <a href="http://mrtopf.de/blog/en/a-small-introduction-to-python-eggs/" target="_blank">here</a> or <a href="http://packages.python.org/distribute/easy_install.html" target="_blank">here</a>. Now you can use pip or <a href="http://pypi.python.org/pypi/distribute" target="_blank">distribute</a> to do the same thing. All three can also install packages that are in compressed archives. Normally, all you have to do to install a package with one of these utilities is something like this:</p>
<p><code><br />
easy_install PackageName<br />
pip install PackageName<br />
</code></p>
<p>Read their respective docs for more information though.</p>
<h2>Other Handy Packages for Windows Developers</h2>
<p>If you are a serious Windows developer who will need access to Windows APIs, then you will require the <a href="http://sourceforge.net/projects/pywin32/" target="_blank">PyWin32</a> package. You&#8217;ll want to become familiar with <a href="http://docs.python.org/library/ctypes.html" target="_blank">ctypes </a>too, but that&#8217;s been included with Python since version 2.5. PyWin32 is a lightweight wrapper around the Windows APIs. You can actually look on MSDN for the API documentation and almost directly translate it into Python. The ctypes package put on an even lower level and can be used to interact with DLLs directly, among many other things.</p>
<p>Another common need when programming on Windows is access to Window Management Instrumentation (WMI). Fortunately, Tim Golden has written a nice <a href="http://timgolden.me.uk/python/wmi/index.html" target="_blank">wmi module</a>. You can usually get the same information using PyWin32, but it&#8217;s more convoluted than just using WMI. Tim Golden has also written several other utilities:</p>
<ul>
<li><a href="http://timgolden.me.uk/python/winsys/index.html" target="_blank">WinSys</a> &#8211; Python tools for the Windows Administrator</li>
<li><a href="http://timgolden.me.uk/python/winshell.html" target="_blank">winshell</a> &#8211; a utility for getting Windows paths easily</li>
<li>An <a href="http://timgolden.me.uk/python/active_directory.html" target="_blank">Active Directory</a> wrapper</li>
</ul>
<p>You should also check out his awesome &#8220;<a href="http://timgolden.me.uk/python/win32_how_do_i.html" target="_blank">How Do I</a>&#8221; series of tutorials. </p>
<p>Finally, Python includes a module called <strong>_winreg</strong> that you can use to gain access to the Windows Registry. It&#8217;s a very powerful tool that&#8217;s very useful if you do a lot of administrative scripting on Windows.</p>
<h2>Other Python Installations for Windows</h2>
<p>The comments section started filling up with people mentioning the special Python installations you can get that actually include PyWin32 and other packages all wrapped up in one installer. That is also an option. Here are a few of those:</p>
<ul>
<li>PythonXY &#8211; This one includes a TON of other packages, including PyWin32, SciPy, wxPython, NumPy and dozens of others. It looks like a jack of all trades. I have not used this one, but it sounds interesting.</li>
<li>The <a href="http://www.enthought.com/products/getepd.php" target="_blank">Enthought Python Distribution</a> &#8211; That link is their paid version, but there&#8217;s also a <a href="http://enthought.com/products/epd_free.php" target="_blank">lightweight free version</a> available too.</li>
<li><a href="http://www.activestate.com/activepython/downloads" target="_blank">ActivePython </a>from ActiveState &#8211; this one has been around for a long time and includes the PyWin32 documentation and various other tools.</li>
</ul>
<h2>Wrapping Up</h2>
<p>You should now have all the tools you need to be an effective Windows developer with Python. If you need help, the PyWin32 and ctypes mailing lists are active and they have experts there that can answer just about anything you&#8217;d want to know about those packages.</p>
<h2>Further Reading</h2>
<ul>
<li>A Python Windows Registry <a href="http://www.blog.pythonlibrary.org/2010/03/20/pythons-_winreg-editing-the-windows-registry/" target="_blank">tutorial</a></li>
<li>Some other article on MvP about <a href="http://www.blog.pythonlibrary.org/tag/windows/" target="_blank">Windows and Python</a></li>
<li>Official <a href="http://docs.python.org/using/windows.html" target="_blank">Python documentation</a> on Windows</li>
<li>Another tutorial on <a href="http://www.imladris.com/Scripts/PythonForWindows.html" target="_blank">Python on Windows</a></li>
<li>PyWin32 <a href="http://docs.activestate.com/activepython/2.7/pywin32/PyWin32.HTML" target="_blank">documentation </a>from ActiveState</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.pythonlibrary.org/2011/11/24/python-101-setting-up-python-on-windows/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Book Preview: Numpy 1.5 Beginner&#8217;s Guide</title>
		<link>http://www.blog.pythonlibrary.org/2011/11/23/book-preview-numpy-1-5-beginners-guide/</link>
		<comments>http://www.blog.pythonlibrary.org/2011/11/23/book-preview-numpy-1-5-beginners-guide/#comments</comments>
		<pubDate>Wed, 23 Nov 2011 14:56:56 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[NumPy]]></category>

		<guid isPermaLink="false">http://www.blog.pythonlibrary.org/?p=2060</guid>
		<description><![CDATA[Recently, I was linked to the Python Forum because one of my friends on the wxPython IRC channel said that Packt was trying to find reviewers for their new book, Numpy 1.5 Beginner&#8217;s Guide by Ivan Idris. I doubt they&#8217;re going to find many people on that website though. I&#8217;ve certainly never heard of it. [...]]]></description>
			<content:encoded><![CDATA[<div class="socialize-in-content" style="float:left;"><div class="socialize-in-button socialize-in-button-left"><a href="http://twitter.com/share" class="twitter-share-button" data-counturl="http://www.blog.pythonlibrary.org/2011/11/23/book-preview-numpy-1-5-beginners-guide/" data-url="http://bit.ly/tRGrUI" data-text="Book Preview: Numpy 1.5 Beginner&#8217;s Guide" data-count="vertical" data-via="socializeWP" ><!--Tweetter--></a></div><div class="socialize-in-button socialize-in-button-left"><iframe src="http://www.facebook.com/plugins/like.php?href=http://www.blog.pythonlibrary.org/2011/11/23/book-preview-numpy-1-5-beginners-guide/&amp;layout=button_count&amp;show_faces=true&amp;width=100&amp;action=like&amp;font=arial&amp;colorscheme=light&amp;height=65" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px !important; height:65px;" allowTransparency="true"></iframe></div><div class="socialize-in-button socialize-in-button-left"><script type="text/javascript">
			<!-- 
			reddit_url = "http://www.blog.pythonlibrary.org/2011/11/23/book-preview-numpy-1-5-beginners-guide/";
			reddit_title = "Book Preview: Numpy 1.5 Beginner&#8217;s Guide";	//-->
		</script><script type="text/javascript" src="http://www.reddit.com/static/button/button2.js"></script></div><div class="socialize-in-button socialize-in-button-left"><g:plusone size="small" href="http://www.blog.pythonlibrary.org/2011/11/23/book-preview-numpy-1-5-beginners-guide/"></g:plusone></div></div><p>Recently, I was linked to the <a href="http://www.python-forum.org/pythonforum/viewtopic.php?f=1&#038;t=30554" target="_blank">Python Forum</a> because one of my friends on the wxPython IRC channel said that Packt was trying to find reviewers for their new book, <em>Numpy 1.5 Beginner&#8217;s Guide</em> by Ivan Idris. I doubt they&#8217;re going to find many people on that website though. I&#8217;ve certainly never heard of it. Anyway, Packt was kind enough to give me a copy of it as an ebook, so I&#8217;ll be reading it over the next couple of weeks so I can review it for this website. <span id="more-2060"></span></p>
<p>I haven&#8217;t used NumPy before, but I hear about it from time to time on the wxPython mailing list and I thought it sounded interesting. So I am glad that there&#8217;s a new beginner&#8217;s book on the topic. I hope it&#8217;s a good one. In the meantime, Packt gave me a link to <a href="http://www.packtpub.com/sites/default/files/5306OS-Chapter-3-Get-into-Terms-with-Commonly-Used-Functions.pdf?utm_source=packtpub&#038;utm_medium=free&#038;utm_campaign=pdf" target="_blank">chapter 3</a>, so you can read that while you wait for my review. It looks like <a href="http://www.dougfinke.com/blog/index.php/2011/11/22/numpy-1-5-beginners-guide/" target="_blank">Doug Finke</a> will also be doing a review of this book too, so you may want to keep an eye on his blog to see what he thinks too.</p>
<table>
<tr>
<td><a href="http://www.blog.pythonlibrary.org/wp-content/uploads/2010/12/numpy_book.jpg"><img src="http://www.blog.pythonlibrary.org/wp-content/uploads/2010/12/numpy_book-241x300.jpg" alt="" title="numpy_book_cover" width="241" height="300" class="aligncenter size-medium wp-image-2061" /></a></td>
<td>
<h3>Numpy 1.5 Beginner&#8217;s Guide</h3>
<p><p>By Ivan Idris</p>
<p><strong><a href="http://www.amazon.com/gp/product/1849515301/ref=as_li_ss_tl?ie=UTF8&#038;tag=thmovsthpy-20&#038;linkCode=as2&#038;camp=217145&#038;creative=399373&#038;creativeASIN=1849515301" rel="nofollow">Amazon</a></strong></p>
<p><strong><a href="http://www.packtpub.com/numpy-1-5-using-real-world-examples-beginners-guide/book">Packt</a></strong></br>
</td>
</tr>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.pythonlibrary.org/2011/11/23/book-preview-numpy-1-5-beginners-guide/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>wxPython: ANN: Namespace Diff Tool</title>
		<link>http://www.blog.pythonlibrary.org/2011/11/10/wxpython-ann-namespace-diff-tool/</link>
		<comments>http://www.blog.pythonlibrary.org/2011/11/10/wxpython-ann-namespace-diff-tool/#comments</comments>
		<pubDate>Thu, 10 Nov 2011 13:15:54 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[wxPython]]></category>

		<guid isPermaLink="false">http://www.blog.pythonlibrary.org/?p=2028</guid>
		<description><![CDATA[Last night, Andrea Gavana released his new Namespace Diff Tool (NDT) to the world. I got his permission to reprint his announcement here for all those people who don&#8217;t follow the wxPython mailing list. I think it sounds like a really cool tool. You should check it out and see what you think. Here is [...]]]></description>
			<content:encoded><![CDATA[<div class="socialize-in-content" style="float:left;"><div class="socialize-in-button socialize-in-button-left"><a href="http://twitter.com/share" class="twitter-share-button" data-counturl="http://www.blog.pythonlibrary.org/2011/11/10/wxpython-ann-namespace-diff-tool/" data-url="http://bit.ly/vwpxHc" data-text="wxPython: ANN: Namespace Diff Tool" data-count="vertical" data-via="socializeWP" ><!--Tweetter--></a></div><div class="socialize-in-button socialize-in-button-left"><iframe src="http://www.facebook.com/plugins/like.php?href=http://www.blog.pythonlibrary.org/2011/11/10/wxpython-ann-namespace-diff-tool/&amp;layout=button_count&amp;show_faces=true&amp;width=100&amp;action=like&amp;font=arial&amp;colorscheme=light&amp;height=65" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px !important; height:65px;" allowTransparency="true"></iframe></div><div class="socialize-in-button socialize-in-button-left"><script type="text/javascript">
			<!-- 
			reddit_url = "http://www.blog.pythonlibrary.org/2011/11/10/wxpython-ann-namespace-diff-tool/";
			reddit_title = "wxPython: ANN: Namespace Diff Tool";	//-->
		</script><script type="text/javascript" src="http://www.reddit.com/static/button/button2.js"></script></div><div class="socialize-in-button socialize-in-button-left"><g:plusone size="small" href="http://www.blog.pythonlibrary.org/2011/11/10/wxpython-ann-namespace-diff-tool/"></g:plusone></div></div><p>Last night, Andrea Gavana released his new Namespace Diff Tool (NDT) to the world. I got his permission to reprint his announcement here for all those people who don&#8217;t follow the wxPython mailing list. I think it sounds like a really cool tool. You should check it out and see what you think. Here is the <a href="https://groups.google.com/forum/#!topic/wxpython-users/oK8dfnLQ7Rc" target="_blank">announcement</a>:<span id="more-2028"></span></p>
<p>
<p><em>Description<br />
===========</p>
<p>The `Namespace Diff Tool` (NDT) is a graphical user interface that can<br />
be used to discover differences between different versions of a library,<br />
or even between different iterations/sub-versions of the same library.</p>
<p>The tool can be used to identify what is missing and still needs to be<br />
implemented, or what is new in a new release, which items do not have<br />
docstrings and so on.</p>
<p>Full description of the original idea by Robin Dunn:</p>
<p><a href="http://svn.wxwidgets.org/viewvc/wx/wxPython/Phoenix/trunk/TODO.txt?view=markup" target="_blank">http://svn.wxwidgets.org/viewvc/wx/wxPython/Phoenix/trunk/TODO.txt?vi</a>&#8230;</p>
<p>:warning: As most of the widgets in the GUI are owner drawn or custom,<br />
 it is highly probable that the interface itself will look messy on other<br />
 platforms (Mac, I am talking to you). Please do try and create a patch to<br />
 fix any possible issue in this sense.</p>
<p>:note: Please refer to the TODOs section for a list of things that still<br />
need<br />
 to be implemented.</p>
<p>Requirements<br />
============</p>
<p>In order to run NDT, these packages need to be installed:</p>
<p>- Python 2.X (where 5 <= X <= 7);<br />
- wxPython >= 2.8.10;<br />
- SQLAlchemy >= 0.6.4.</p>
<p>More detailed instructions on how to use it, TODO items, list of<br />
libraries/packages I tested NDT against, screenshots and download links can<br />
be found here:</p>
<p><a href="http://xoomer.virgilio.it/infinity77/main/NDT.html" target="_blank">http://xoomer.virgilio.it/infinity77/main/NDT.html</a></p>
<p>If you stumble upon a bug (which is highly probable), please do let me<br />
know. But most importantly, please do try and make an effort to create a<br />
patch for the bug. </em></p>
<p>According to the <a href="https://groups.google.com/forum/#!topic/wxpython-users/oK8dfnLQ7Rc" target="_blank">thread</a>, some bugs were already found and fixed. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.pythonlibrary.org/2011/11/10/wxpython-ann-namespace-diff-tool/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 4.510 seconds -->

