HOPStudio commited on
Commit
f455ebc
·
verified ·
1 Parent(s): 3f2f0bb

Update start_jupyterlab.py

Browse files
Files changed (1) hide show
  1. start_jupyterlab.py +2 -2
start_jupyterlab.py CHANGED
@@ -31,7 +31,7 @@ def modify_jupyter_config():
31
  f.write("\n# Allow remote access\n")
32
  f.write("c.ServerApp.allow_remote_access = True\n")
33
  f.write("c.ServerApp.ip = '0.0.0.0'\n")
34
- f.write("c.ServerApp.port = 8888\n") # 设置端口
35
  f.write("c.ServerApp.token = ''\n") # 禁用 token
36
  f.write("c.ServerApp.allow_origin = '*'\n")
37
  f.write("c.ServerApp.allow_root = True\n")
@@ -48,7 +48,7 @@ def start_jupyter_lab():
48
  sys.executable, "-m", "jupyter", "lab",
49
  "--no-browser", # 禁止自动打开浏览器
50
  "--ip=0.0.0.0", # 允许外部访问
51
- "--port=8888", # 指定端口为 8888
52
  ]
53
  subprocess.Popen(command, stdout=sys.stdout, stderr=sys.stderr)
54
  print("JupyterLab 已启动,请通过 http://<服务器IP>:8888 访问。")
 
31
  f.write("\n# Allow remote access\n")
32
  f.write("c.ServerApp.allow_remote_access = True\n")
33
  f.write("c.ServerApp.ip = '0.0.0.0'\n")
34
+ f.write("c.ServerApp.port = 18888\n") # 设置端口
35
  f.write("c.ServerApp.token = ''\n") # 禁用 token
36
  f.write("c.ServerApp.allow_origin = '*'\n")
37
  f.write("c.ServerApp.allow_root = True\n")
 
48
  sys.executable, "-m", "jupyter", "lab",
49
  "--no-browser", # 禁止自动打开浏览器
50
  "--ip=0.0.0.0", # 允许外部访问
51
+ "--port=18888", # 指定端口为 18888
52
  ]
53
  subprocess.Popen(command, stdout=sys.stdout, stderr=sys.stderr)
54
  print("JupyterLab 已启动,请通过 http://<服务器IP>:8888 访问。")