code: def start_jupyter(self, args):
          
          install_func = partial(run_cmd, show_output=logger.verbose)
  
          try:
              install_func(["jupyter", "--version"])
          except CalledProcessError:
              jupyter = "ipython"
          else:
              jupyter = "jupyter"
  
          # always install kernels if given no args, otherwise only if there's a kernel missing
          do_install = not args
          if not do_install:
              kernel_list = run_cmd([jupyter, "kernelspec", "list"], show_output=False, raise_errs=False)
              do_install = any(ker not in kernel_list for ker in icoconut_kernel_names)
  
          if do_install:
              success = True
              for icoconut_kernel_dir in icoconut_kernel_dirs:
                  install_args = [jupyter, "kernelspec", "install", icoconut_kernel_dir, "--replace"]
                  try:
                      install_func(install_args)
                  except CalledProcessError:
                      user_install_args = install_args + ["--user"]
                      try:
                          install_func(user_install_args)
                      except CalledProcessError:
                          logger.warn("kernel install failed on command'", " ".join(install_args))
                          self.register_error(errmsg="Jupyter error")
                          success = False
              if success:
                  logger.show_sig("Successfully installed Coconut Jupyter kernel.")
  
          if args:
              if args[0] == "console":
                  ver = "2" if PY2 else "3"
                  try:
                      install_func(["python" + ver, "-m", "coconut.main", "--version"])
                  except CalledProcessError:
                      kernel_name = "coconut"
                  else:
                      kernel_name = "coconut" + ver
                  run_args = [jupyter, "console", "--kernel", kernel_name] + args[1:]
              else:
                  run_args = [jupyter] + args
              self.register_error(run_cmd(run_args, raise_errs=False), errmsg="Jupyter error")
docs: Start Jupyter with the Coconut kernel.