我一直在尝试使用以下代码从python中获取用户的输入:
workingDir = " "
def specifyDir():
#workingDir = raw_input("Enter Working Dir")
workingDir = input("Enter Working Dir")
specifyDir()
我收到此错误:
Traceback (most recent call last):
File "/Users/akrapf/Desktop/Misc/Programming/Python/Catalog/catalog.py", line 14, in <module>
specifyDir()
File "/Users/akrapf/Desktop/Misc/Programming/Python/Catalog/catalog.py", line 11, in specifyDir
workingDir = input()
EOFError: EOF when reading a line
[Finished in 0.0s with exit code 1]
[shell_cmd: python -u "/Users/akrapf/Desktop/Misc/Programming/Python/Catalog/catalog.py"]
我已经尝试过对此进行研究,我发现有多人说使用SublimeREPL来解决这个问题。我安装了这个并再次尝试没有运气。 raw_input()
或input()
都无效。