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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T08:21:39+00:00 2026-06-02T08:21:39+00:00

I use NppExec/Notepad++ to run Python scripts, and flush my output buffers continuously during

  • 0

I use NppExec/Notepad++ to run Python scripts, and flush my output buffers continuously during runtime to update my console window with print statements (The default buffered output only shows all print statements after the script finishes execution).

This link shows that all you need to do is use the command python -u to get unbuffered output. Is there a downside to using this execution mode for all my Python scripts, regardless of the editor used? I’m not clear about the difference between a buffered an unbuffered output.

EDIT: I included this small Python timer script for an example:

#!usr/bin/env python
import time
import threading
import sys

class Timer(threading.Thread):
    def __init__(self, seconds):
        self.runTime = seconds
        threading.Thread.__init__(self)
    def run(self):
        counter = self.runTime
        for sec in range(self.runTime):
            print counter
            time.sleep(1.0)
            counter -= 1
        print "Done."

if __name__ == '__main__':
    t = Timer(10)
    t.start()

How much difference does a buffered and unbuffered output make in terms of efficiency in this case?

  • 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-02T08:21:40+00:00Added an answer on June 2, 2026 at 8:21 am

    Buffered output means that the computer spools the output somewhere in memory until a certain amount has accumulated. Then it writes the entire block at once. This is more efficient than using unbuffered output which writes the output as soon as you request for it to be written.

    The downside is that your programs will run a little (or a lot) slower depending on how much output you’re writing. If they’re short programs which don’t do too much output, you’re unlikely to notice a difference…

    EDIT

    buffered vs. unbuffered output isn’t only a python question. The same concepts (and terms) apply to other languages as well. In lower level languages it becomes even more important in some ways — If I write messages in a C program using buffered output, and then my program dies because of a programming error, any of the data that was spooled before the error, but not written to disk is lost. That’s not such a problem because it is reasonably difficult to get the python interpreter to abort on an error — even if your code is bad, the interpreter still cleans up alright in the end…(unless you send a kill signal to it or something)…

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

Sidebar

Related Questions

I've just discovered the NppExec console in Notepad++, which I would really like to
use Rack::Static, :urls => ['/stylesheets', '/images'], :root => 'public' run proc { |env| [200,
use pthread_create to create limited number of threads running concurrently Successfully compile and run
Use case: You have 2-3 files displayed in your MacVim window(s). You press ctrl+Q
I want to make notepad++ run the ruby {filename_here} command if the current filename
use case is simple: I want to run some boiler plate code before each
Use case: User clicks a link, a modal window is displayed containing one big
'''use Jython''' import shutil print dir(shutil) There is no, shutil.move, how does one move
Use case: A does something on his box and gots stuck. He asks B
Use case: 3rd party application wants to programatically monitor a text file being generated

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.