Skip to content

Instantly share code, notes, and snippets.

@douglascamata
Created March 27, 2011 18:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save douglascamata/889452 to your computer and use it in GitHub Desktop.
Save douglascamata/889452 to your computer and use it in GitHub Desktop.
A buildout Python interpreter
import sys
sys.path[0:0] = [
'/home/user/.pythonenvs/video/lib/python2.6/site-packages/nsi.multimedia-0.1.2-py2.6.egg',
'/mnt/hgfs/nsi/aos/video/eggs/nsi.videoconvert-0.1-py2.6.egg',
'/mnt/hgfs/nsi/aos/video/eggs/celery-2.2.4-py2.6.egg',
'/home/user/.pythonenvs/video/lib/python2.6/site-packages/restfulie-0.8.0-py2.6.egg',
'/usr/lib/python2.6/dist-packages',
'/usr/lib/python2.6/dist-packages',
'/home/user/.pythonenvs/video/lib/python2.6/site-packages/Twisted-10.2.0-py2.6-linux-i686.egg',
'/home/user/.pythonenvs/video/lib/python2.6/site-packages',
'/home/user/.pythonenvs/video/lib/python2.6/site-packages',
'/home/user/.pythonenvs/video/lib/python2.6/site-packages',
'/home/user/.pythonenvs/video/lib/python2.6/site-packages',
'/home/user/.pythonenvs/video/lib/python2.6/site-packages',
'/mnt/hgfs/nsi/aos/video/eggs/setuptools-0.6c12dev_r88795-py2.6.egg',
]
_interactive = True
if len(sys.argv) > 1:
_options, _args = __import__("getopt").getopt(sys.argv[1:], 'ic:m:')
_interactive = False
for (_opt, _val) in _options:
if _opt == '-i':
_interactive = True
elif _opt == '-c':
exec _val
elif _opt == '-m':
sys.argv[1:] = _args
_args = []
__import__("runpy").run_module(
_val, {}, "__main__", alter_sys=True)
if _args:
sys.argv[:] = _args
__file__ = _args[0]
del _options, _args
execfile(__file__)
if _interactive:
del _interactive
__import__("code").interact(banner="", local=globals())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment