shell - 我在 PyCharm 中得到 'Inappropriate ioctl for device',但不是正常的 shell

标签 shell python-3.x pycharm

我正在编写一个脚本,该脚本可以在 Ubuntu 14.04 中的普通 bash shell 中正常运行。但是,当它从 PyCharm 中运行时,我得到:

termios.error: (25, 'Inappropriate ioctl for device')



只需要这段代码:
from prompt_toolkit import prompt

text = prompt('Give me some input: ')
print('You said: %s' % text)

来自 Python 提示工具包 https://github.com/jonathanslenders/python-prompt-toolkit 中的“入门”示例这是 python 3.4 虚拟环境中唯一安装的包。

由于这是 PyCharm 中集成调试器的运行方式,我该如何修复它以便调试器正常运行?

最佳答案

您可以将 Pycharm 调试器附加到在 Pycharm 之外执行的进程。
转到工具 -> 附加到进程并选择正确的进程。 See Pycharm docs

关于shell - 我在 PyCharm 中得到 'Inappropriate ioctl for device',但不是正常的 shell,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34368532/

相关文章:

mongodb - 为什么我不能直接分配 ListField 的值?

python-3.x - PyCharm:无法在同一窗口中打开两个项目

bash - 为什么${##parameter}总是返回0?

qt - 通过 QProcess 运行 .sh 脚本时出错

python - 使用字典和 re.compile() 进行搜索

Python:Xpath 为 For 循环中的每个 DIV 获取值时出现问题

PyCharm from Six.moves 导入队列 : unresolved reference 'queue'

python - 警告 : Expected type [Class Name], 改为 'Dict[str, int]'

json - 指向文件的硬链接(hard link)在 OS X 上未按预期工作

linux - 如何在linux中使用grep查找所有包含特定命令的文件?