The subtitle for this article could easily be “How To Create PDFs with Python”, but WordPress doesn’t support that. Anyway, the premier PDF library in Python is Reportlab. It is not distributed with that standard library, so you’ll need to download it if you want to run the examples in this tutorial. There will also be at least one example of how to put an image into a PDF, which means you’ll also need the Python Image Library (PIL). As I understand it, Reportlab is compatible with Python 2.x, IronPython and Jython. They are currently working on a port for Python 3.x (or will be soon). (more…)
Mon 8 Mar 2010
A Simple Step-by-Step Reportlab Tutorial
Posted by Mike under Cross-Platform, Python
[2] Comments
Sat 6 Mar 2010
Book Review: Python Testing
Posted by Mike under Python
No Comments
Before PyCon, I was approached by a representative from Packt Publishing to review one of their books. They wanted me to read Daniel Arbuckle’s Python Testing: Beginner’s Guide. I’m not really into testing frameworks or test driven development and thought this would be a good excuse to learn the methodology and see if it was something that was actually valuable or just a lot of hype. The book is only 256 pages long, so I told the Packt contact that it would probably take me a week or so to review. After a week, she seemed kind of anxious that I wasn’t done. Thus, this is a partial review. I don’t like being pressured to review something fast. I want my reviews to be thorough and of the best quality I can make them. You will get a thorough review of the chapters that I did manage to finish. If you want a full review, I’m pretty sure someone else on Python Planet said they were doing one. (more…)
Fri 5 Mar 2010
Python: Finding the Commit Charge Values in Windows
Posted by Mike under Python, Windows
No Comments
This week I was tasked with trying to find a way to find out what the Peak Commit value was on our virtual workstations. The reason being that we are trying to save money and were wondering if we were allocating too much memory or not. We didn’t need the Total Commit Charge or the Limit Commit Charge values, but since I figured out how to get those during my research, I’ll show how to get those as well. (more…)
Wed 3 Mar 2010
Finding Installed Software using Python
Posted by Mike under Python, System Administration, Windows
No Comments
Have you ever wondered what software was installed on your PC? Most people who use Windows would probably go to Add/Remove Programs to find out this information, but they’re not programmers. No, programmers have to script it because it’s just in our blood to do so. I actually had another reason to do so: my boss wanted me to log what was installed on our user’s PCs so we’d know if our users were installing unauthorized software. Thus, there’s also a practical reason to attempt this. (more…)
Sun 28 Feb 2010
PyCon 2010 and Volunteering
Posted by Mike under PyCon
[5] Comments
This year, I decided to volunteer at PyCon. At both my previous PyCons, I had planned to help, but wasn’t sure how to join in. The evening before the tutorials started in 2009, I wandered all over the hotel looking for PyCon staff and found no one. Once the tutorials started, I felt pretty drained in the evenings because I was taking the maximum number of tutorials and that’s a lot of information to soak up. But back to this year. I volunteered to be a Session Chair for one session. It was an interesting experience. I got to meet a fair number of cool Python people, although the only ones that I really saw after the session were Stani and Nadia. (more…)
Thu 25 Feb 2010
Creating Windows Shortcuts with Python (Part II)
Posted by Mike under PyWin32, Python, System Administration
No Comments
Back when I first wrote about creating shortcuts with Python last month, I kept thinking to myself that I had a 3rd way of doing it. Today, I had to maintain some of my shortcut code and I stumbled upon it once more. I also noticed that my post had received a comment from Tim Golden on yet another way to create shortcuts, so I’ll include that in this post as well. (more…)
Mon 22 Feb 2010
PyCon 2010: Sunday Plenaries
Posted by Mike under PyCon
[5] Comments
The last plenary session for PyCon 2010 was on Sunday. In it, Van Lindberg told us that if we included all the vendors, our conference had hit over 1100 people. What that meant is that for PyCon 2011, they would probably have to put an attendance cap of 1500 so that we wouldn’t run out of room at the current venue. Is this good? I don’t really know. Sometimes it felt like it was already too big. Time will tell. (more…)
Mon 22 Feb 2010
PyCon 2010: Sunday Morning Lightning Talks
Posted by Mike under PyCon
No Comments
The last morning Lightning talks were on Sunday. I wasn’t able to stay for the Lightning talks that were given in the afternoon. Here’s a quick run-down (note that I wasn’t able to get the presenter’s name on a lot of these because they would show their first slide for just a few scant seconds):
- Please Pirate – This one was given over half an hour BEFORE lightning talks were scheduled. I don’t know why. His talk’s website is www.pleasepirate.com. His premise was that people should encourage others to pirate their intellectual property. It was pretty confusing, actually. He doesn’t think Creative Commons goes far enough either.
- You can write stored procedures in postgres – This was like a 60 second advertisement.
- PyAr – Natalia from the Argentina Python Users group spoke on how their group started and its mission / vision. It has 650+ members with a mailing list of 11000+ messages per month. She also talked about what they do as a group, such as PyCamps and sprints (cocos2d, lalita, CDPedia)
- Python Spring Cleanup – go home, figure out how to contribute to python, demo your stuff at a Python Users Group, get others to do it too
- You got your Cython in my NumPy – by D. Huggins – Went through a bunch of iterations of k-means code to show how Cython could make Python code much faster. He messed up at the end, so we never got to see how fast it really was.
- PiCloud – inspiration was facebook photo-tagging assistant but it turned into some kind of cloud-computing program. I didn’t really follow this very well, but they seem to have created a “cloud” module/package that allows you to utilize Amazon’s resources (EC2?) to do calculations.
- Mox – Mobile web in Django, presented by Tim Fernando from Oxford, UK – Molly is a soon-to-be open source project that focuses on providing web content to mobile devices. Example (I think) is m.ox.ac.uk. It also does maps and it’s RESTful
- CCP Games guy – custom stackless or socket api (accent is hard to understand), used cherrypy’s thread test to compare against his program to show that his version was super fast. I couldn’t read the screen, so I don’t know if he proved anything or not.

Sun 21 Feb 2010
PyCon 2010 Open Spaces
Posted by Mike under PyCon
[4] Comments
PyCon 2010 continued the practice of Open Spaces (if you don’t know what those are, click here). I really enjoyed the Open Space track last year and greatly looked forward to it this year. Unfortunately, I only managed to get to one and that was the wxPython BoF that I had posted on the board. The major flaw that I saw this year was that there were two contradictory Open Space boards. There was one outside the doors into the Open Space corridor that had blocks given using the 24-hour time format (i.e. 1300 hours) and then was another board just inside the doorway with the same room letters and most of the same times, but in normal U.S. format (i.e. 1 p.m., 2 p.m., etc). Thus, it was very hard to know which board to follow.
For example, I wanted to go to the Python Authors BoF (BoF = Birds of a Feather). When I went down there, the outside board said it was in so-and-so and the inside board was blank. I went looking for this room, but found other people instead (I think they were the django folk). I don’t know where the authors thing was or if it even happened.
My wxPython BoF fared no better. I had put down my time slot on both boards in hopes of mitigating the confusion, but there was some huge group in the room I had reserved anyway. They left about 5-10 minutes after my BoF was supposed to start, which I think caused us to lose participants. We only had 6 people show up whereas last year it was closer to triple that amount.
All in all though, I think the wxPython BoF was alright because I got to meet the two major developers behind Dabo, Ed Leafe and Paul McNett. And Stani showed up too, so I was able to rub shoulders with a few of the cool people of the wxPython niche. We discussed various projects we were working on and helped a wxPython newbie.
Another annoyance was that there never seemed to be any cards handy to fill out to post on the board(s)!. If I’m able to attend PyCon next year, I hope that this area of the conference is shown more love.
Sat 20 Feb 2010
PyCon 2010: Saturday Session 3 (late afternoon) – Think Globally, Hack Locally
Posted by Mike under PyCon
No Comments
I only attended one of the two talks in the last session of the day. It was presented by Ms. Leigh Honeywell and called Think Globally, Hack Locally – Teaching Python in Your Community.
She started “Python Newbie Night” in Toronto, Canada. It was an informal, peer-taught class which often put code up on the wall with a projector. They would work through the Python book, “How to Think Like a Computer Scientist” which has chapter exercises (the book is online for free at http://thinkpython.com). She was in a hackerspace (her local one was hacklab.co) and seemed to recommend them. She gave a list of venues for teaching programming such as Community centres, churches, retirement homes, schools, jails and more. She also mentioned that the University of Toronto has switched to teaching Python from Java (I think).
She spoke on what worked for these classes and what didn’t work so well. For the most part, the talk was just general purpose tips for teaching Python. I do most of the stuff that she talks about for Pyowa (local python users group) and completely agree that doing it alone sucks. I also agree that teaching others about Python can be very rewarding. I thought this was a nice informal talk that would be informative to people who have never done this before. If you plan to start a user’s group, watching her talk or reading her slides would be a step in the right direction.
