【发布时间】:2019-05-15 14:47:24
【问题描述】:
我正在尝试做最基本的事情,即尝试通过输入功能从键盘读取。
我尝试在提供的其他链接中查看其他解决方案。但这对我没有帮助。因为那些是先前声明输入的那些。 它给我带来了错误:-
File "<ipython-input-169-5d707bffda8e>", line 1, in <module>
a = input("Enter the number")
TypeError: '_io.TextIOWrapper' object is not callable
我尝试使用“输入”从键盘获取输入
a = input("Enter the number")
TypeError: '_io.TextIOWrapper' object is not callable
【问题讨论】:
-
你似乎用什么东西覆盖了
input... -
我使用的是 python 3.x 版本。输入未在代码中的其他任何地方使用。 'a' 不是文件
-
你能在产生错误的那一行前面加上一个
print(input),然后把它打印出来吗?如果您发布整个代码,而不仅仅是一行代码,帮助您也会容易得多。 -
@Boris - 当我尝试打印(输入)时。它给了我以下信息:-print(input) <_io.textiowrapper name="sample.txt" mode="r" encoding="cp1252">
标签: python python-3.x