【问题标题】:Has anyone been able to get bullet to work in Colab?有没有人能够让子弹在 Colab 中工作?
【发布时间】:2020-04-06 05:07:21
【问题描述】:

我正在 Colab 中测试“子弹”。我安装了子弹,它似乎可以导入。我得到'error: (25, 'Inappropriate ioctl for device')'。它确实要求我在它破裂之前选择一种水果。 我会在其他地方尝试,但我在工作,无法这样做。这是来自子弹回购的一个例子。

from bullet import Bullet
cli = Bullet(prompt = "n\ Please choose a fruit: ",
            choices = ['apple', 'banana', 'orange', 'watermelon', 'strawberry'],
            indent = 0,
            align = 5,
            margin = 2,
            shift = 0,
            bullet = "",
            pad_right = 5
        )

result = cli.launch()
print("You chose: ", result)

【问题讨论】:

  • 我认为 Bullet 使用 unix 样式的 tty 控件,我认为这些方法在 Jupyter 笔记本中不起作用,因为它是一个 Web 应用程序,而不是真正的标准 unix 控制台。您可能想尝试使用小部件(其中一些在 colab 中工作)。 ipywidgets.readthedocs.io/en/latest/examples/…
  • 好的,谢谢亚伦。我会检查一下。我只是选择了子弹,因为我已经多次听到它被提及以及有多少人喜欢它。

标签: python python-3.x package google-colaboratory


【解决方案1】:

我可能不知道 'bullet' 是否可以在 Colab 中使用的答案,但我知道它在 PythonAnywhere 中可以使用 - 至少就我而言。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-01-09
    • 1970-01-01
    相关资源
    最近更新 更多