Skip to content

Instantly share code, notes, and snippets.

@gerad
Created April 28, 2010 20:48
Show Gist options
  • Save gerad/382684 to your computer and use it in GitHub Desktop.
Save gerad/382684 to your computer and use it in GitHub Desktop.
Setup an interactive console for Google AppEngine - similar to script/console in Rails.
"""Convenience wrapper for starting an interactive appengine console."""
import os
import sys
from subprocess import call
DIR_PATH = os.path.abspath(os.path.dirname(os.path.realpath('/usr/local/bin/dev_appserver.py')))
EXTRA_PATHS = [
DIR_PATH,
os.path.join(DIR_PATH, 'lib', 'antlr3'),
os.path.join(DIR_PATH, 'lib', 'django'),
os.path.join(DIR_PATH, 'lib', 'ipaddr'),
os.path.join(DIR_PATH, 'lib', 'webob'),
os.path.join(DIR_PATH, 'lib', 'yaml', 'lib'),
]
if __name__ == '__main__':
addl_path = os.pathsep.join(EXTRA_PATHS + sys.path)
call('PYTHONPATH=' + addl_path + ' python', shell=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment