def start_python_console(namespace=None, noipython=False):
 if (namespace is None):
  namespace = {}
 try:
  try:
   if noipython:
    raise ImportError
   import IPython
   try:
    IPython.embed(user_ns=namespace)
   except AttributeError:
    shell = IPython.Shell.IPShellEmbed(argv=[], user_ns=namespace)
    shell()
  except ImportError:
   import code
   try:
    import readline
   except ImportError:
    pass
   else:
    import rlcompleter
    readline.parse_and_bind('tab:complete')
   code.interact(banner='', local=namespace)
 except SystemExit:
  pass

def start_python_console ( namespace = None , noipython = False ) : if ( namespace is None ) : namespace = { } try : try : if noipython : raise ImportError import IPython try : IPython . embed ( user_ns = namespace ) except AttributeError : shell = IPython . Shell . IPShellEmbed ( argv = [ ] , user_ns = namespace ) shell ( ) except ImportError : import code try : import readline except ImportError : pass else : import rlcompleter readline . parse_and_bind ( 'tab:complete' ) code . interact ( banner = '' , local = namespace ) except SystemExit : pass
start python console binded to the given namespace .