Book Review: Think Complexity – Complexity Science and Computational Modeling
Book Review: Think Complexity – Complexity Science and Computational Modeling Read More »
Earlier this week, I wrote a simple post about Python’s Queues and demonstrated how they can be used with a threading pool to download a set of PDFs from the United States Internal Revenue Service’s website. Today I decided to try “porting” that code over to Python’s multiprocessing module. As one of my readers pointed
Python Concurrency: Porting from a Queue to Multiprocessing Read More »
Python provides a very powerful logging library in its standard library. A lot of programmers use print statements for debugging (myself included), but you can also use logging to do this. It’s actually cleaner to use logging as you won’t have to go through all your code to remove the print statements. In this tutorial
Python 101: An Intro to logging Read More »
Python comes with a lot of cool concurrency tools builtin, such as threads, Queues, semaphores and multiprocessing. In this article, we’ll spend some time learning how to use Queues. A Queue can be used for first-in-first out or last-in-last-out stack-like implementations if you just use them directly. If you’d like to see that in action,
Python Concurrency: An Example of a Queue Read More »
Today on StackOverflow I saw someone who wanted to know how to drag a file from a wx.ListCtrl onto their Desktop or somewhere else in the file system. They were using the file manager skeleton from zetcode, but couldn’t figure out how to add the DnD portion. After a bit of searching and hacking, I
wxPython: How to drag and drop a file from your app to the OS Read More »
Every now and then you’ll find yourself needing to load modules or classes dynamically. In other words, you’ll want to be able to import a module without knowing ahead of time which one you’re going to import. In this article, we’ll look at two ways to accomplish this feat in Python. Using the __import__ Magic
Advanced Python – How to Dynamically Load Modules or Classes Read More »
List comprehensions in Python are very handy. They can also be a little hard to understand when and why you would use them. List comprehensions tend to be harder to read than just using a simple for loop as well. We’ll spend some time looking at how to construct list comprehensions and learn how they
Python 201: List Comprehensions Read More »
Today we’re going to take a look at Tkinter! I was curious about how one would go about hiding a frame and then re-showing it using Tkinter and I kept finding threads (like this one) that talked about using withdraw() and deiconify() but didn’t really provide any usable code. In wxPython, I did this sort
Tkinter: How to Show / Hide a Window Read More »
Today on StackOverflow I saw someone wondering how to bind two functions / methods to the same event in wxPython. It’s really quite easy. Here’s one example:
wxPython: How to Fire Multiple Event Handlers Read More »
Mercurial is a free, distributed source control versioning tool, similar to git or bazaar. Some might even compare it CVS or Subversion (SVN), although those are not distributed versioning systems. The Python programming core development team chose to switch to Mercurial from SVN a couple years ago and many other high profile 3rd party Python
An Intro to Mercurial Read More »
While researching PDF libraries for Python, I stumbled across another little project called metaPDF. According to its website, metaPDF is a lightweight Python library optimized for metadata extraction and insertion, and it is a fast wrapper over the excellent pyPdf library. It works by quickly searching the last 2048 bytes of the PDF before parsing
Python PDF Series – An Intro to metaPDF Read More »
Some teens from around the world decided to learn Python using Raspberry Pi to write a game during a sprint starting today and running through tomorrow. They are taking donations to give to the Raspberry Pi foundation too. You can follow their live stream if you want to. Raspberry Pi is an ARM GNU/Linux box
Raspithon starts today! Read More »
There are lots of different ways to download a file from the internet using Python. One popular way is to connect to an FTP server and download your files that way. So that is what we will be looking at in this article. All you need is your standard installation of Python. It includes a
Python 101: Downloading a File with ftplib Read More »
SQLite is a self-contained, server-less, config-free transactional SQL database engine. Python gained the sqlite3 module all the way back in version 2.5 which means that you can create SQLite database with any current Python without downloading any additional dependencies. Mozilla uses SQLite databases for its popular Firefox browser to store bookmarks and other various pieces
Python: A Simple Step-by-Step SQLite Tutorial Read More »
Note: The following post was originally published over on Dzone. I changed the title because I already wrote several XML parsing articles and don’t want my readers to get this one confused with the others. One of the common tasks I am given in my day job is to take some data format input and
Parsing XML and Creating a PDF Invoice with Python Read More »