Accitental hang up

Tim Peters tim.one at home.com
Sun Dec 31 19:50:36 EST 2000


[Nadav Horesh]
> I occasionally work with very large arrays (>100000 elements):
> sometimes, when I accidentally type a name of an array followed by <CR>
> python hangs while trying to format the array for output.  Is there a
> nice way to abort the process without closing the python session?

It's not hung, but it may take a verrrrrry long time to complete building
the output string.  If Ctrl-C doesn't interrupt it, you're stuck.  PEP 217
proposes to add a display hook for interactive use, which you could fiddle
to special-case arrays (or whatever else you wanted to customize about the
default shell output):

    http://python.sourceforge.net/peps/pep-0217.html





More information about the Python-list mailing list