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 7837401
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T14:37:37+00:00 2026-06-02T14:37:37+00:00

Short Question Is it possible/practical to write and update a multi-line (contains \n )

  • 0

Short Question
Is it possible/practical to write and update a multi-line (contains \n) string on a Windows terminal?

Background
I have looked into curses, but it is Unix only. I saw a few other Window ports, but it was a bit troubling that Windows XP was an experimental OS for one them. I am hoping to use this as part of a diagnostic feature to display link status, message rates, etc on a mainly terminal application (note that some variants do have a wxPython GUI input). That being said, using Cygwin is non-ideal and would love to find a workaround using only the sys module.

I have tried the following: (note that I expected them to fail, but hoped I would be wrong)
Attempt 1: Updates the string but it is all on 1 line

sys.stdout.write("\r")
sys.stdout.write("This is a multi-line screen print test") 
sys.stdout.write("Line 1") 
sys.stdout.write("Line 2") 
sys.stdout.flush()  

Attempt 2: Does not update but prints all the lines

sys.stdout.write("\r")
sys.stdout.write("This is a multi-line screen print test\n") 
sys.stdout.write("Line 1 \n") 
sys.stdout.write("Line 2\n") 
sys.stdout.flush()
  • 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-06-02T14:37:38+00:00Added an answer on June 2, 2026 at 2:37 pm

    The closest thing I could find to curses (that has been updated in the last 10 years) was Windows Console Driver. Rather than use this approach I went at it was a less elegant method.

    import os
    import time
    
    while(1):
        time.sleep(.05)
        os.system('cls')
        print "This is a multi-line screen print test"
        print "Line 1" 
        print "Line 2" 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a short question: How is it possible to convert a String, containing
I have a really short question: Is it possible to communicate/use USB devices on
Short question, but can't make it work. I have a string: COMPANY NAME -
Short question: Is it possible to do a redirection, say when a user isn't
a short question: is it possible to assign the result of a calculation within
I have searched through google and SO for possible answers to this question, but
Short question : is it possible (on an x64 OS of course) ? If
Good day, I have a practical mysql question to which I can't find help
Short question since I don't know how to search for this. Can I re-update
The short question: how can I (or is it possible to) make use 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.