Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6386275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:00:16+00:00 2026-05-25T03:00:16+00:00

For a standard Python Console window, you can remove the last line with for

  • 0

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.

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?

edit: Checking type(os.sys.stdout) shows:

  • SciTe: <type 'file'>
  • Idle: <class 'idlelib.rpc.RPCProxy'>
  • Eclipse: <type 'file'>
  • Python Console Window: <type 'file'>

In the standard python console stdout, the result stdout.write('\r') of is different from the consoles of SciTe and Eclipse, thus the type of the stdout does not define its implementation.

edit: just saw java folks having similar problem and reported is as a bug…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T03:00:17+00:00Added an answer on May 25, 2026 at 3:00 am

    I am comming to the conclusion that it is not possible, please correct me if I am wrong.

    Python Console Window (terminal) does not ‘flush’ the written line until the next line is passed, as if it keeps a carriage returns like ‘\n’ in memory that can be ignored when writing(‘\r). The other, more GUI based console windows (IDE’s) are obviously implemented differently. So perhaps it could be a feature request to interprete ‘\r’ to erase a previous line in these consoles, so that all consoles share at least a common behaviour to the standard console, only perhaps with additional options.

    A solution meanwhile for me as user could be to change the sys.stdout to a new console window, which is questioned before, but answered unsatisfactory… Anybody evolved a bettor opinion to this?

    Or use something like the curses module, but than for Windows (is there a ‘curses.py’ for Windows?), e.g. Console.py.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can someone please explain algorithm for itertools.permutations routine in Python standard lib 2.6? I
I am aware that the standard Python convention for line width is 79 characters.
On my server, I'm using the standard example for Python (with an extra Hello
In the standard Python documentation, system calls appear as bold, fixed-width font. You can
I need information about any standard python package which can be used for longest
Python's pickle (I'm talking standard Python 2.5/2.6/2.7 here) cannot pickle locks, file objects etc.
I was learning python using the tutorial that comes with the standard python installation.
What's ActivePython actually about? From what I've read it's just standard Python with OpenSSL
Is it possible to decorate/extend the python standard logging system, so that when a
Does Python have a unit testing framework compatible with the standard xUnit style of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.