简体   繁体   English

在Spyder中运行当前代码行

[英]Running current line of code in Spyder

I am having an insanely annoying problem in python, which I will illustrate with screenshots of my output. 我在python中遇到了一个令人烦恼的问题,我将用输出的屏幕快照来说明。

To preface, today Spyder 'magically' disappeared from my computer, leaving only its icon behind. 作为序言,今天Spyder“神奇地”从我的计算机上消失了,只留下了它的图标。 I thought I was able to fix this problem by downloading anaconda and re-downloading Spyder. 我以为我可以通过下载anaconda并重新下载Spyder来解决此问题。 The app now opens correctly, but I am having trouble getting the console to run a selected line of code. 该应用程序现在可以正确打开,但是我无法让控制台运行选定的代码行。

Now, when I am running my code, it takes two tries to get any output from the console, and once that bridge has been crossed, every time I try to run a specific line after that, on the first attempt, I get the output from whichever line I ran right before it. 现在,当我运行我的代码时,需要两次尝试才能从控制台获取任何输出,并且一旦桥接器被越过,每次我尝试在那之后运行特定的行时,第一次尝试时,我都会得到输出无论从哪条线我都在它前面跑过。 I do get the right output on the second try, but obviously I cannot really write/test my programs like this. 我确实在第二次尝试中获得了正确的输出,但是显然我不能真正编写/测试我的程序。

The above description is probably somewhat confusing, so I've included a picture to illustrate what I'm talking about: 上面的描述可能有些混乱,因此我提供了一张图片来说明我在说什么:

在此处输入图片说明

Does anyone have any idea why this is happening???? 有谁知道为什么会这样吗????

This is caused by some bugs in the Python console on Windows. 这是由Windows上的Python控制台中的一些错误引起的。 Because of this and other errors, it's going to be removed in Spyder 3.2 . 由于这个和其他错误,它将在Spyder 3.2中删除。

Please use the IPython console instead. 请改用IPython控制台。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM