【问题标题】:Spyder: typing an opening bracket in console puts focus on internal consoleSpyder:在控制台中输入左括号会将焦点放在内部控制台上
【发布时间】:2014-11-01 16:14:25
【问题描述】:

我最近在 ubuntu 12.04 上重新安装了 spyder。这是问题所在: 当我在控制台中键入左括号时,焦点立即切换到内部控制台,显示错误(我将其解释为“缺少右括号”?)虽然我很欣赏代码监控,但如果控制台允许我会很好在下结论之前先完成我的代码行。

如何避免这种行为? (我不介意内部控制台中显示的“错误”,但是每当我打开一个括号时切换到内部控制台是非常具有破坏性的。)

这是内部控制台的输出:

Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/spyder-2.3.0-py2.7.egg/spyderlib/widgets/shell.py", line 298, in keyPressEvent
self.postprocess_keyevent(event)
File "/usr/local/lib/python2.7/dist-packages/spyder-2.3.0-py2.7.egg/spyderlib/widgets/shell.py", line 727, in postprocess_keyevent
ShellBaseWidget.postprocess_keyevent(self, event)
File "/usr/local/lib/python2.7/dist-packages/spyder-2.3.0-py2.7.egg/spyderlib/widgets/shell.py", line 438, in postprocess_keyevent
self._key_parenleft(text)
File "/usr/local/lib/python2.7/dist-packages/spyder-2.3.0-py2.7.egg/spyderlib/widgets/shell.py", line 797, in _key_parenleft
self.show_object_info(last_obj, call=True)
File "/usr/local/lib/python2.7/dist-packages/spyder-2.3.0-py2.7.egg/spyderlib/widgets/mixins.py", line 608, in show_object_info
signature=True, color='#2D62FF')
File "/usr/local/lib/python2.7/dist-packages/spyder-2.3.0-py2.7.egg/spyderlib/widgets/mixins.py", line 108, in show_calltip
self.calltip_widget.show_tip(point, tiptext, wrapped_textlines)
File "/usr/local/lib/python2.7/dist-packages/spyder-2.3.0-py2.7.egg/spyderlib/widgets/calltip.py", line 157, in show_tip
forward=False)
File "/usr/local/lib/python2.7/dist-packages/spyder-2.3.0-py2.7.egg/spyderlib/widgets/calltip.py", line 252, in _find_parenthesis
while category(char) != 'Cc' and position > 0:
TypeError: need a single Unicode character as parameter

【问题讨论】:

  • 听起来像是应该向 spyder 的开发人员报告的错误...
  • @Freundchen,您使用的是 ubuntu 软件包还是安装了其他版本的 spyder?您能否提供有关您的设置的更多信息。
  • 我通过 apt-get 安装了 ubuntu 包。抱歉,我不是专家 - 我可以提供更多信息吗?
  • (Spyder dev here) 您能否发布一个示例来显示您遇到的错误?还是您在控制台中编写的 每个 括号都会发生这种情况?

标签: python console spyder


【解决方案1】:

要在内部控制台上不显示错误,您需要转到

Tools > Preferences > General > Debugging

并停用调用的选项

[ ] Pop up internal console when internal errors appear

【讨论】:

  • ...我一直忽略了这一点...哎呀我!非常感谢!
  • 请不要忘记给我们一个简单的例子来重现您的问题,以便我们为每个人解决它:)
猜你喜欢
  • 1970-01-01
  • 2011-03-14
  • 1970-01-01
  • 2018-05-26
  • 2019-05-01
  • 1970-01-01
  • 2022-12-18
  • 2020-07-02
  • 2019-02-22
相关资源
最近更新 更多