【发布时间】:2019-01-16 14:14:33
【问题描述】:
我正在 Python 3.6 上开发一个小脚本,我很可能会在 Google Cloud Shell 中使用它。在所述脚本中,我想做一些 API 调用,然后用 URL 打开 Web 浏览器,这些调用的结果。以下代码适用于我测试过的其他环境,但不适用于 Cloud Shell:
import webbrowser as wb
# different calls and process here, not relevant to the issue
wb.open('URL_HERE')
#This just echoes the URL.
有没有办法让 Python '告诉' Cloud Shell 从它运行的地方使用浏览器?即:如果我使用 Chrome 打开 Cloud Shell,有没有办法在 Chrome 中打开链接?使用 webbrowser 或其他库都没关系。
【问题讨论】:
标签: python-3.x google-cloud-platform google-cloud-shell