def start(self): command = f"source .bash_profile; jupyter-lab {self.directory} --no-browser --port={self.port} 2>&1" print(command) p = Popen(['ssh', '-T', f'{self.host}', command], stdin=PIPE, stdout=PIPE, stderr=PIPE, universal_newlines=True) p.stdin.flush() while True: l = p.stdout.readline().strip() if l != None and l != "" and l.startswith("or http://127.0.0.1"): # print (f"{l}") url = l.split(" ")[1] self.tunnel() Shell.browser(url)
def open(self): location = f"https://localhost:{self.port}/lab?" print("Open", location) Shell.browser(location)