简单的输入功能给spyder一个内部问题

Simple input function gives spyder an internal problem

这是我正在尝试的代码 运行。

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'

如有任何帮助,我们将不胜感激。谢谢!

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

有关升级到 5.3.0 的说明。