Пример #1
0
def ipython_shell(user_ns):
    from IPython.terminal.ipapp import TerminalIPythonApp
    from IPython.terminal.interactiveshell import TerminalInteractiveShell

    class MyIPythonApp(TerminalIPythonApp):

        def init_shell(self):
            self.shell = TerminalInteractiveShell(
                prompts_class=MyPrompt, highlighting_style='emacs',
                display_banner=False, profile_dir=self.profile_dir,
                ipython_dir=self.ipython_dir, banner1=get_banner(), banner2='')
            self.shell.configurables.append(self)

    app = MyIPythonApp.instance()
    app.initialize()
    app.shell.user_ns.update(user_ns)
    sys.exit(app.start())
Пример #2
0
def ipython_shell(user_ns):
    from IPython.terminal.ipapp import TerminalIPythonApp
    from IPython.terminal.interactiveshell import TerminalInteractiveShell

    class MyIPythonApp(TerminalIPythonApp):
        def init_shell(self):
            self.shell = TerminalInteractiveShell(prompts_class=MyPrompt,
                                                  highlighting_style='emacs',
                                                  display_banner=False,
                                                  profile_dir=self.profile_dir,
                                                  ipython_dir=self.ipython_dir,
                                                  banner1=get_banner(),
                                                  banner2='')
            self.shell.configurables.append(self)

    app = MyIPythonApp.instance()
    app.initialize()
    app.shell.user_ns.update(user_ns)
    sys.exit(app.start())
Пример #3
0
__author__ = 'chao'
from app import app

app.start()

Пример #4
0
def main() -> None:
    try:
        emit_heartbeats(connection_factory)
        app.start()
    except Exception as e:
        log.error(f'Application stopped: {str(e)}')
Пример #5
0
from app import app
from commands import getCovidStats
# Start app
if __name__ == "__main__":
    app.start(port=3000)
def run():
    app.start()