【问题标题】:Simple input function gives spyder an internal problem简单的输入函数给 spyder 一个内部问题
【发布时间】:2022-06-10 21:54:30
【问题描述】:

这是我要运行的代码。

x = int(input("Please enter and integer: "))

for n in range(2,x+1):
    for t in range(2, n):
            if n%t ==0:
                print(n,'equals',t,'*', n/t)
                break
    else:
        print(n, 'is a prime number')

这是我不断收到的错误代码。值得注意的是,如果 x 有一个预先确定的变量,代码就可以工作。

Traceback (most recent call last):
  File "C:\Users\ausam\anaconda3\lib\site-packages\qtconsole\base_frontend_mixin.py", line 138, in _dispatch
    handler(msg)
  File "C:\Users\ausam\anaconda3\lib\site-packages\spyder\plugins\ipythonconsole\widgets\debugging.py", line 278, in _handle_input_request
    return super(DebuggingWidget, self)._handle_input_request(msg)
  File "C:\Users\ausam\anaconda3\lib\site-packages\qtconsole\frontend_widget.py", line 512, in _handle_input_request
    self._readline(msg['content']['prompt'], callback=callback, password=msg['content']['password'])
  File "C:\Users\ausam\anaconda3\lib\site-packages\qtconsole\console_widget.py", line 2422, in _readline
    self._show_prompt(prompt, newline=False, separator=False)
TypeError: _show_prompt() got an unexpected keyword argument 'separator'

任何帮助将不胜感激。谢谢!

【问题讨论】:

    标签: python scripting anaconda spyder


    【解决方案1】:

    此错误已在 Github 上报告,据说已修复。见https://github.com/spyder-ide/spyder/issues/17616

    升级到 5.3.0 的说明。

    【讨论】:

      【解决方案2】:

      它对我不起作用。我只是得到一个窗口来向 github 报告它

      【讨论】:

        猜你喜欢
        • 2011-08-24
        • 1970-01-01
        • 1970-01-01
        • 2011-04-08
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-03-08
        • 1970-01-01
        相关资源
        最近更新 更多