views:

93

answers:

1

This is absolutely frustrating, but I am not sure if the following is an issue only on my machine or with IDLE in general.

When attempting to print a long list in the shell, and that could happen by accident while debugging, the program crushes and you have to restart it manually.

Even worse, if you have a few editor windows open, it always spawns a few sub-processes, and each of these has to be manually shut down from the task manager.

Is there any way to avoid that?

I am using Python 3, by the way.

A: 

It seems tk needs to write a lot of data in the shell frame, this takes a lot of time and when the list is long then it becomes unresponsive.

I did:

>>a = range(n)
>>print(list(a))

It was OK for n = 100 or n = 1000. After that point things started being slow. For n as low as 10000, moving the page up and down becomes very, very slow.

I suspect that there is no solution. For small values of n probably it would help to clear() the window but unfortunately idle have not implemented any method to clear the shell. I dont understand why because it should not be difficult...

joaquin
Patches welcome, I'm sure. I suspect it's nowhere near as easy as you think because IDLE itself is written in Python, and executes most of these things in the main process.
Thomas Wouters
@Thomas: I was just wondering, with little idea about idle internals, you know: ignorance is bold. Sure, being it easy it would have been fixed before. Still, for the common user and the beginner (many python books drive you to start learning with idle), it is choking that the 'official' shell-editor shipped with python have some of these problems and limitations.
joaquin