0

Is there any reason why python interpretor will automatically restart when a recursive function is called? I'm programming a quick sort algorithm, and trying to sort a an large array of digits (order 10^4), but when I try to sort the full array python is restarting, i.e. giving me:

============================== RESTART ==============================

and all the values/functions stored in memory disappears. N.B. the code works fine for smaller values (<10^4). Is there fail safe been triggered due to the large amount of recursion?

added: python & IDLE info:

enter image description here

4

1 回答 1

1

您最有可能在 IDLE 中收到此消息。在 IDLE 中,“===RESTART===”只是 IDLE 刷新其先前代码的内存。

更新

如果您通过右键单击程序并选择“使用 IDLE 编辑”进入 IDLE,则不会出现这些 ====RESTART==== 消息;IDLE 以稍微不同的模式运行。但一切仍然有效。

在此处阅读有关 IDLE的更多信息

于 2012-07-02T05:01:24.210 回答