python-3.x - 代码不会要求用户输入?

标签 python-3.x

我是 Python 编程的初学者。使用 Python3 上课。

我的代码是:

#!/usr/binpython3
import arduino
def loop():
      contin = True
      while contin:
             userinput = input()
             if userinput == "quit":
                      contin = False
             else:
                      contin = True

我卡在代码的“userinput = input()”部分。出于某种原因,我的程序不会要求用户输入。我该如何解决这个问题?

谢谢!

最佳答案

您实际上是在调用该函数吗?也就是说,您是在代码末尾说 loop() 吗?

关于python-3.x - 代码不会要求用户输入?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43299748/

相关文章:

python-3.x - 获取半径内相邻元素的索引

python - python数据框中所有行的零索引

python - (Python)如何将整数列表转换为集合列表,其中每个集合都是这些整数中的一对?

python - 不同的除法结果python

拆分字符串并解压缩为变量的 Pythonic 方法?

python - python中的日期格式不一致

python - 非空 gcs 存储桶返回 "can only concatenate str (not "字节") 到 str"

python - 如何不断检查 JSON 文件是否在 Python 中更新?

json - 序列化和反序列化 pandas periodIndex 系列

python - Mongoengine 聚合不像 mongo 那样工作