def load_path(filename): "Load a font file, searching along the Python path." for dir in sys.path: if Image.isDirectory(dir): try: return load(os.path.join(dir, filename)) except IOError: pass raise IOError("cannot find font file")