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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:35:45+00:00 2026-06-03T05:35:45+00:00

I write Python scripts with NppExec/Notepad++. How do I update my console window as

  • 0

I write Python scripts with NppExec/Notepad++. How do I update my console window as each line of my Python code is executed? For example, the following timer script:

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

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()

When I run in this in a command prompt window, it live updates every second. But in NppExec console, it updates only after exit. Is there a way to get the NppExec console to behave as the command prompt and update continuously?

  • 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-03T05:35:46+00:00Added an answer on June 3, 2026 at 5:35 am

    All that needs to be done is invoke the python -u command to run the script, i.e. python -u timer.py instead of python timer.py

    This prints output in unbuffered mode by default. For custom output flushing in more detailed programs, the stdout definition has to be rewritten.

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

Sidebar

Related Questions

I mostly write small scripts in python, about 50 - 250 lines of code.
Is it possible to write Python scripts in HTML code similarly as you write
Let's say there are two python scripts that want to write data to the
I typically write my scripts with a structure like s #!/usr/bin/python import stuff def
Can python cgi scripts write and read data to the session? If so how?
To launch programs from my Python-scripts, I'm using the following method: def execute(command): process
I write a lot of parallel scripts in python for research purposes and was
I want to write some install scripts by python, it should know the OS
I've written a simple program that captures and executes command line Python scripts, but
I would like to write some scripts in python that do some automated changes

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.