#!/usr/bin/env python import sys import os.path import errno # Program path package_dir = os.path.join("%%PROGRAM_DIR%%") # Add package_dir to python path sys.path.append(package_dir) # Dotdir to store game configs etc. dotdir = os.path.join(os.environ["HOME"], ".gondola") # Create directory try: os.mkdir(dotdir) except OSError, e: if e.errno != errno.EEXIST: raise # Chdir into it os.chdir(dotdir) # Launch the program! execfile(os.path.join(package_dir, "run_game.py"))