Windows


Editor’s note: This is a guest post from Yasoob Khalid who authors the Free Python Tips blog

So hi there guys! I hope you are fine. So what is in this post? Today we will be writing a cleanup script. The idea for this post came from Mike Driscoll who recently wrote a very useful post about writing a cleanup script in python. So how is my post different from his post? (more…)

The other day I was trying to figure out a way to monitor the print queue on Windows. The task at hand was to keep track of what documents went to the printer and completely successfully. The idea was that when the print completed, the document would then be archived. To do this sort of thing, you need PyWin32 (AKA: Python for Windows extensions). In this article, we’ll look at a simple script that checks the print queue. (more…)

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’re done, but if you’re going to do Windows development, then you’ll need a few other packages to make it nicer. (more…)

TurboGears is one of several web frameworks for Python that are available. The most popular by far is Django. Where I work, we chose TurboGears because of its integration with SQLAlchemy which supports composite keys. At that time, Django did not support that feature and I am not sure if it does yet. Anyway, I develop almost exclusively on a Windows box and have found the TurboGears’ documentation on the subject a little confusing. So here’s how I do it.

Note: We’ll be using TurboGears 2.1 in this tutorial (more…)

Last week, there was an interesting thread on the PyWin32 mailing list about how to read Microsoft Access databases with Python without having Access actually installed. Vernon Cole had the solution, but I noticed that Google doesn’t seem to index the PyWin32 list very well, so I decided to write about it here. (more…)

A couple of months ago at work, we received a report that a file was locked. The dialog that appeared showed the initials of a user who wasn’t even working for us any more. Thus we discovered an annoying bug that can crop up with Office. Basically, a user is asked by Word or Excel to input their name and initials during the first run of that respective application and it will keep that data no matter who logs into the machine later on. This can lead to some serious confusion when we get error messages of this sort. Anyway, let’s take a quick look at how to get this done. (more…)

Update (10/12/2010) – One of my alert readers told me that SqlAlchemy 0.6.x currently does NOT support the Access dialect. Read here for more info.

A year or two ago, I was asked to transfer some data from some old Microsoft Access files to our Microsoft SQL Server. Since I enjoy using SqlAlchemy, I decided to see if it supported Access. The documentation at the time was pretty unhelpful in this regard, but it did seem to be possible and I found one thread about it on SqlAlchemy’s Google group. (more…)

The other day, I was tasked with finding a way to get a list of all running processes on a Windows XP virtual machine. I was also supposed to include information about how much CPU and memory each process used. Fortunately, this didn’t have to be a remote script, but one that could be run on the client. After a fair bit of Googling here and there, I finally found a solution. In this article, we’ll look at some of the rejects as well as the eventual solution, which happens to work cross-platform. (more…)

After about a year or so at my current job, as we were still working on upgrading the last few Windows 98 machines to Windows XP, we had a need to check which machines on our network were getting low on disk space. The issue was cropping up because we had Windows XP loaded on several machines that had 10 GB hard drives and a few with 20 GB and one or two with just 4 GB. Anyway, after some digging online, I discovered that the PyWin32 package could accomplish what I needed. (more…)

The bbfreeze package also allows us to create binaries, but only on Linux and Windows. It’s just an easy_install away, so if you plan on following along with the examples in the article, you should go get it. The bbfreeze package includes egg support, so it can include egg dependencies in your binary, unlike py2exe. You can also freeze multiple scripts at once, include the Python interpreter and more. According to bbfreeze’s PyPI entry, it’s only been tested with Python 2.4-2.5, so keep that in mind. However, I was able to use it with Python 2.6 with no obvious problems. (more…)

Next Page »