#!/usr/bin/env python import commands, os, sys (status, path) = commands.getstatusoutput('which python') args = ['python', '-O', 'application.py'] args.extend(sys.argv[1:]) os.execv(path, args)