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

  • Home
  • SEARCH
  • 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 8998453
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:01:57+00:00 2026-06-16T00:01:57+00:00

Following the description given here how to create output in python in such a

  • 0

Following the description given here how to create output in python in such a way, that the previous output is overwritten, I tried the following code

from __future__ import print_function
import time

for val in range(10):
    time.sleep(0.2)
    print(val, end='\r')

but do not see any output at all. With end=\n it works as expected (i.e. the numbers 0 to 9 in a vertical column). What is the reason I do not see any output? Do I need to flush something? Is this operating-system depended (working on Ubuntu Linux)?

  • 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-16T00:01:59+00:00Added an answer on June 16, 2026 at 12:01 am

    I guess that the stream isn’t flushed until it gets a ‘\n’.

    Have a look at this article: Disable output buffering

    Try if it works when you start Python with -u.

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

Sidebar

Related Questions

The following C# code (.NET Framework 3.5) returns name and description of all users
Following on from a recent post. I am creating a search function that queries
I'm following the advice given here in order to find partial words with elasticsearch:
Here's the scoop: I've created a test app that allows users to create ideas
I have the following code that I think should work - however, what I
After writing code that can be boiled down to the following: var size=-1; var
The following code example given for android device administrator application development receiver android:name=.app.DeviceAdminSample$DeviceAdminSampleReceiver What
Given the following model: class Project(models.Model): project_name = models.CharField(max_length=255) abstract = models.TextField(blank=True, null=True) full_description
Probably the following description of the issue I'm encountering will be a bit vague,
I am using PHP/Mongo to query a data set like the following: { description:

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.