def run_server(target, jupyter_args=None, verbosity=1): RPZKernelManager.rpz_target = target RPZKernelManager.rpz_verbosity = verbosity if not jupyter_args: jupyter_args = [] logger.info("Starting Jupyter notebook") NotebookApp.launch_instance(argv=jupyter_args, kernel_manager_class=RPZMappingKernelManager)
def start_notebook(verbose, filename='kpop.ipynb'): try: from notebook.notebookapp import NotebookApp from jupyter_client import KernelManager except ImportError: raise ImportError( 'you must install the notebook module to run this command.\n' '\nRun one of the following commands:\n' ' $ pip3 install notebook\n' ' $ pip3 install kpop[all]' ) file_path = os.path.join(os.getcwd(), filename) if not os.path.exists(file_path): create_default_notebook_file(file_path) sys.argv[:] = ['notebook', 'kpop.ipynb'] NotebookApp.launch_instance( kernel_manager=KernelManager, kernel_name='python', )
extension.load_config_file() extension.update_config(serverapp.config) extension.parse_command_line(serverapp.extra_args) extension.initialize() def _jupyter_server_extension_paths(): return [ { 'module': 'jupyterlab.browser_check' } ] if __name__ == '__main__': skip_options = ["--no-browser-test", "--no-chrome-test"] for option in skip_options: if option in sys.argv: BrowserApp.test_browser = False sys.argv.remove(option) if "--notebook" in sys.argv: from notebook.notebookapp import NotebookApp NotebookApp.default_url = "/lab" sys.argv.remove("--notebook") NotebookApp.nbserver_extensions = {"jupyterlab.browser_check": True} NotebookApp.open_browser = False NotebookApp.launch_instance() else: BrowserApp.launch_instance()
def main(): NotebookApp.launch_instance(notebook_dir=NOTEBOOK_DIRECTORY)