Blog / Python

Deadlock issue when using Python’s subprocess module

September 24, 2010

I ran into an issue yesterday when calling an external Java application from Python using the subprocess module. The Java application loaded but appeared to have stopped executing after loading its properties files (last entry in the log file is after loading the properties file).

My Python code looked something like this:

import subprocess

javaApplication = subprocess.Popen(["java", "-jar", "application.jar"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)

# The wait() function is actually not a good idea to use
# when …

Python’s ‘zipfile’ Module

July 8, 2010

I was writing some scripts today and part of it is to compress some files. I normally make an external application call to 7-Zip command line when I do this, but then I decided to just do a quick Google search to see if Python has one built in.

It turned out there’s this zipfile module that’s part of the standard library that can compress and decompress files for you (only the standard ZIP compression …

Newer