Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion colabcode/code.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""base code"""
import os
import subprocess
import random

from pyngrok import ngrok

Expand Down Expand Up @@ -33,7 +34,7 @@ def __init__(
self, port=10000, password=None, mount_drive=False, add_extensions=None
):
self.port = port
self.password = password
self.password = int(random.random() * 1e4) if password is None else password
self._mount = mount_drive
self._install_code()
self.extensions = EXTENSIONS
Expand Down Expand Up @@ -89,5 +90,6 @@ def _run_code(self):
bufsize=1,
universal_newlines=True,
) as proc:
print(f"Use password {self.password} to login")
for line in proc.stdout:
print(line, end="")