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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:07:57+00:00 2026-05-28T05:07:57+00:00

I got a long running program that I don’t want to kill, but I

  • 0

I got a long running program that I don’t want to kill, but I do want to see the output that it has (which is one sentence every hour or so).

I know now that I needed to flush the output in my script (e.g. sys.stdout.flush()), but since I don’t want to kill it, I’m hoping there is some clever linux command to do this. From what I’ve read online, the typical linux behavior is to flush this when the buffer fills up.

If nobody knows answer, do you have any idea of how big this buffer is? It would be nice to at least get an idea of when to check back 🙂

[this is on Ubuntu 10]

  • 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-28T05:07:58+00:00Added an answer on May 28, 2026 at 5:07 am

    To find out the buffer size for sys.stdout in Ubuntu 11.10 I used the following simple program:

    import sys, time
    
    buf_size = 1024
    for counter in xrange(buf_size):
        sys.stdout.write('a')
    time.sleep(3)
    

    The experiment is as follows:

    • If buf_size is too big, part of the string is printed immediately to the console and the remaining part after three seconds.
    • If buf_size is too small, the whole output is printed after three seconds.

    In my case, when the buffer size is set to 1024, I don’t get any output until the program exits, but when I set it to 1025 I see a lot of characters and, after three seconds, one more character is printed.

    Hence, the buffer size in my system is 1024. In your system is probably the same, but you can repeat the experiment to confirm.

    For the future, please find below some links that can be helpful:

    • python: is it possible to attach a console into a running process
    • Python output buffering
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We got a long-running website where XSS lurks. The problem comes from that some
I want to write a shell script that spawns several long-running processes in the
I have a WPF (C# and .NET 4) application that has a long running
I've got a long running, daemonized Python process that uses subprocess to spawn new
I've got a long-running script, and the operations that it performs can be broken
I have a long running task and a Dialog which informs the User that
I've got a long running method -- and I want to indicate to the
I've got a class which abstracts performing long running methods on a background thread
I've got one long GridView control on ma website. It allows row selection. The
i've got a hundred pages long high quality PDF (66MB) that needs to be

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.