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 them into something like this:


'Jia_01.Jpg', 'Jia_02.Jpg', 'Jia_09.Jpg', 'Jia_10.Jpg', 'Jia_101.Jpg', 'Jia_11.Jpg'

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 glob 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. (more…)

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 of users using his website. It not only tracks the books you have borrowed, but it’ll auto-renew them if it can and let you know if you’re books are overdue.

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 Puppet, Vagrant and Fabric to manage his server’s settings and back them up.

The second talk was done by myself and I spoke on my MediaLocker 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.

Overall, I’d say that we had a really good meeting with 10 people showing up. Next month, on February 2nd, we’re bringing in the BIG guns though. We have Doug Hellman and Steve Holden scheduled to Skype in and talk to us.

Doug Hellman is the author of The Python Standard Library By Example, 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

Steve Holden is chairman of the Python Software Foundation and author of Python Web Programming. He owns Python consulting business and does Python training.

Everyone likes retrospective articles. I’m not sure why, but lists just pull people in. Last year, my top ten list was pretty popular, so this year I’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.

  1. A Simple Step-by-Step Reportlab Tutorial
  2. with 16,378 page views, posted 03/08/2010

  3. How to Send Email with Python with 11,459 page views, posted 05/14/2010
  4. A cx_Freeze Tutorial – Build a Binary Series! with 9,735 page views, posted 08/12/2010
  5. Python and Microsoft Office – Using PyWin32 with 9,336 page views, posted 07/16/2010
  6. Another Step-by-Step SqlAlchemy Tutorial (part 1 of 2) with 7,990 page views, posted 02/03/2010
  7. Python: Parsing XML with minidom with 7,900 page views, posted 11/12/2010
  8. Manipulating PDFs with Python and pyPdf with 7,304 page views, posted 05/15/2010
  9. wxPython: wx.ListCtrl Tips and Tricks with 7,265 page views, posted 01/04/2011
  10. Reportlab Tables – Creating Tables in PDFs with Python with 6,634 page views, posted 09/21/2010
  11. Python 101: How to Open a File or Program with 6,440 page views, posted 09/04/2010

Last time, I thought I’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’t super popular with only one making the top ten. Maybe this year I’ll spread out a bit and actually look at some of the other GUI toolkits. I’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’d like to know more about, feel free to ask in the comments and I’ll consider writing about it.

I hope you’re ready for another rocking year of Python programming. I know I am!

I was reading the Python blog feed yesterday and stumbled on Tarek Ziade’s Python Meme article. I thought it sounded like a fun idea, so here’s my answers to his questions. (more…)

This is an unorthodox review of Numpy 1.5 Beginner’s Guide by Ivan Idris. I have to say two things right off before we get into the review:

  • This book was given to me in ebook and physical form directly from Packt Publishing
  • I actually don’t think I have enough math to review this

On that second one, I took college Calculus, but this book talks about terms I either don’t remember or they just weren’t covered. I had Statistics I and II as well, but the author deals more with matrix manipulation and linear algebra. I think my old Finance and Accounting classes helped the most, but that was at the end of the book. (more…)

The wxPython project’s Phoenix release is slowly coming along. Phoenix is the codename for the new wxPython that will support both Python 2.x and 3.x. Anyway, Andrea Gavana has put together some autogenerated documentation using Sphinx on top of Doxygen. You can read about the announcement including any known issues on the wxPython mailing list.

For those of you who are brave, you can also read about a snapshot build of Phoenix here or download the a tarball here. Note: These tarballs are only for Mac and Window users and they are not completely working.

For those of you who don’t know anything about Project Phoenix, you can read about it on the wxPython wiki.

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. (more…)

The 2012 Python Conference USA opened Registration today. The official announcement doesn’t mention it, but I’m pretty sure there’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 “Early Bird” rates which are cheaper!

The complete schedule isn’t done yet, but you can whet your appetite by checking out the list of tutorials that were released last week.

I have enjoyed all the PyCons I’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’t afford to go, they even offer Financial Assistance. So why are you waiting?

Background
================

This is the first release of a real project that I’ve been involved in. I had written an article last month that inspired Werner Bruhin to want to take it and make it into a demonstration program for new wxPython programmers in how to do MVC and CRUD while interfacing with a database. Thus, MediaLocker was born. We hope you like it.

Description
================

A wxPython database application that can help you keep track of your media. Currently, it only tracks your Book library. You can read more about the project’s development in the following two articles:

Requirements
================

- Python 2.6+
- wxPython 2.8.11+ with the new pubsub (download here) or wxPython 2.9.3
- SQLAlchemy 0.7.3+
- ObjectListView 1.2

Configuration
================

After you have downloaded the source, run “python setup_lib.py develop” in the main folder before you try to run “mediaLocker.py”. If you are on wxPython 2.8, download the pubsub path (above) and extract it to “C:\Python27\Lib\site-packages\wx-2.9.2-msw\wx\lib” (or wherever your wxPython is installed).

Source
================

You can download the source from BitBucket: https://bitbucket.org/driscollis/medialocker

You can also just download a snapshot of the current files here (uploaded 2011.12.09 @ 1138 hrs CST):

How you can help
================

Download the software and report bugs on BitBucket. We also happily accept feature requests, especially if they include patches or code.

Note: This has only been tested on Windows XP and 7

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 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 Best Scripting Language too.

Congrats to the Python community and the PSF too!

Hat-tip to Steve Holden who mentioned this on Python.org’s news feed.

Next Page »