How to remove lines from stdout in Python - in SciTe, Idle, Eclipse or other editor with console
For a standard Python Console window, you can remove the last line with for example `sys.stdout.write('\r'+' '*len(line))` as I [explained here](http://stackoverflow.com/questions/3732928/how-to-remove-lines-from-stdout-in-python/6804439#6804439).

But for editors like SciTe, Idle or Eclipse (with PyDev), the stdout is a file-type object, probably flushing its content to the console window leaving its buffer empty and thus not allowing modify the content once it has appeared on in the window. What trick can be applied to, for example, erase the last line of such console? Is there a one-size-fits-all way to do it, generating the same result if the script is run outside of the editor writing to a standard Python Console Window?
How to remove lines from stdout in Python - in SciTe, Idle, Eclipse or other editor with console
===

For a standard Python Console window, you can remove the last line with for example `sys.stdout.write('\r'+' '*len(line))` as I [explained here](http://stackoverflow.com/questions/3732928/how-to-remove-lines-from-stdout-in-python/6804439#6804439).

But for editors like SciTe, Idle or Eclipse (with PyDev), the stdout is a file-type object, probably flushing its content to the console window leaving its buffer empty and thus not allowing modify the content once it has appeared on in the window. What trick can be applied to, for example, erase the last line of such console? Is there a one-size-fits-all way to do it, generating the same result if the script is run outside of the editor writing to a standard Python Console Window?