Exemplo n.º 1
0
def run():

    # overwrite the original IPython Qt widget with our own so we can put a
    # customized banner. IPython may have been installed without Qt support so we
    # protect this code against an import error
    try:
        from IPython.utils.traitlets import Unicode
        from IPython.frontend.qt.console.rich_ipython_widget import RichIPythonWidget

        class ITangoConsole(RichIPythonWidget):

            banner = Unicode(config=True)

            def _banner_default(self):
                config = get_config()
                return config.ITangoConsole.banner

        import IPython.frontend.qt.console.qtconsoleapp
        IPythonQtConsoleApp = IPython.frontend.qt.console.qtconsoleapp.IPythonQtConsoleApp
        IPythonQtConsoleApp.widget_factory = ITangoConsole
    except ImportError:
        pass

    argv = sys.argv

    try:
        for i, arg in enumerate(argv[:1]):
            if arg.startswith('--profile='):
                break
        else:
            argv.append("--profile=tango")
    except:
        pass

    launch_new_instance()
Exemplo n.º 2
0
def run():

    # overwrite the original IPython Qt widget with our own so we can put a
    # customized banner. IPython may have been installed without Qt support so we
    # protect this code against an import error
    try:
        from IPython.utils.traitlets import Unicode
        from IPython.frontend.qt.console.rich_ipython_widget import RichIPythonWidget

        class ITangoConsole(RichIPythonWidget):
            
            banner = Unicode(config=True)

            def _banner_default(self):
                config = get_config()
                return config.ITangoConsole.banner

        import IPython.frontend.qt.console.qtconsoleapp
        IPythonQtConsoleApp = IPython.frontend.qt.console.qtconsoleapp.IPythonQtConsoleApp
        IPythonQtConsoleApp.widget_factory = ITangoConsole      
    except ImportError:
        pass

    argv = sys.argv

    try:
        for i, arg in enumerate(argv[:1]):
            if arg.startswith('--profile='):
                break
        else:
            argv.append("--profile=tango")
    except:
        pass    
        
    launch_new_instance()
Exemplo n.º 3
0
def IPY():
	global ttx
	launch_new_instance()
	#app = TerminalIPythonApp.instance()
	#app.initialize()
	#app.start()

	print("Exiting e22.py")
	ttx=True
Exemplo n.º 4
0
Arquivo: e22.py Projeto: cryoem/test
def IPY():
    global ttx
    launch_new_instance()
    # app = TerminalIPythonApp.instance()
    # app.initialize()
    # app.start()

    print "Exiting e22.py"
    ttx = True
Exemplo n.º 5
0
        def start_new_api(self):

            # No c is available: we can't get @string ipython_argv setting.
            sys.argv =  ['ipython']

            self.started = True

            # Prints signon.
            # self.ip set in update_commander.
            ipapp.launch_new_instance()
Exemplo n.º 6
0
 def ipython(self):
     try:
         # from IPython import embed
         # embed()
         import sys
         sys.argv=['ipython', 'console']
         from IPython.frontend.terminal.ipapp import launch_new_instance
         launch_new_instance()
     except ImportError:
         # IPython < 0.11
         # Explicitly pass an empty list as arguments, because otherwise
         # IPython would use sys.argv from this script.
         try:
             from IPython.Shell import IPShell
             shell = IPShell(argv=[])
             shell.mainloop()
         except ImportError:
             # IPython not found at all, raise ImportError
             raise
Exemplo n.º 7
0
# encoding: utf-8
"""Terminal-based IPython entry point.
"""
#-----------------------------------------------------------------------------
#  Copyright (c) 2012, IPython Development Team.
#
#  Distributed under the terms of the Modified BSD License.
#
#  The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------

from IPython.frontend.terminal.ipapp import launch_new_instance

launch_new_instance()
Exemplo n.º 8
0
#!/usr/bin/python3

import sys

if sys.argv[1:2] == ['kernel']:
	from blender_ipython_wrapper import launch_kernel
	launch_kernel(sys.argv[1:])
else:
	from os.path import abspath, dirname, join as pathjoin

	try:
		from IPython.frontend.terminal.ipapp import launch_new_instance
	except ImportError:
		from IPython.terminal.ipapp import launch_new_instance

	# use wrapper script for starting python processes
	# the wrapper will defer execution to blender, if it was used to start a new kernel
	sys.executable = pathjoin(dirname(abspath(sys.argv[0])), 'blender_ipython_wrapper.py')

	launch_new_instance()
Exemplo n.º 9
0
import sys 
from IPython.frontend.terminal.ipapp import launch_new_instance 
sys.exit(launch_new_instance())
Exemplo n.º 10
0
import IPython.frontend.terminal.ipapp as ipapp
import sys

ipapp.launch_new_instance()
sys.exit()