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())
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())
__author__ = 'chao' from app import app app.start()
def main() -> None: try: emit_heartbeats(connection_factory) app.start() except Exception as e: log.error(f'Application stopped: {str(e)}')
from app import app from commands import getCovidStats # Start app if __name__ == "__main__": app.start(port=3000)
def run(): app.start()