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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:20:28+00:00 2026-05-27T02:20:28+00:00

I need to know if you ever faced slowing or even hang while using

  • 0

I need to know if you ever faced slowing or even hang while using text box to display large amount of data.

In my case I am running a simulation script using subprocess and its stdout is displayed in text box.
The text can be in MBs.

I tried two implementations:

1) The textbox waited for the simulation(subprocess) to finish before it can display the stdout data. This worked out pretty fine.
But the only issue was that i wanted to display the stdout data in real time.

2) I started displaying the data real time-Here the text box was easily displaying stdout data for small processes.
However, when i run long simulation scripts, they are stuck in between.
I know execution of simulation script is halted as relevant output files were not generated.
The screen hang is similar to one we experience in windows.

About Simulation script: This is a single script which can run many other child process (one at a time) using other scripts.

Please advice if you have any solution? Can i use canvas instead of text box? will it help?

Please find the run function as below:

def run():

    filename = str(run_file_name.get())
    command.set("Running "+filename)

    #Creating new Window to display output 
    t = Toplevel(root)
    t.title('output Run Display')
    t.geometry('800x1000-5+40')
    t.state('normal')
    little = Label(t, text="OUTPUT LOG").grid(column = 0, row = 0)
    log = Text(t, state='disabled', width=115, height=150, wrap='none')
    log.grid(row = 1, column = 0)

    test=subprocess.Popen(filename,shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE)# stderr=subprocess.PIPE)
    #stdout
    while True:
        line_out = test.stdout.readline()
            line_er  = test.stderr.readline()
        if line_out == "" and line_er == "":
            break
            else:
                log['state'] = 'normal'
                log.insert('end', line_out)
                    log.insert('end', line_er)
                log['state'] = 'disabled'
                    print line_out
                    print line_er
                    t.update()

The main target is to run the subprocess and show all the output on textbox, hence to delink the user from command prompt interface.
Remark from my debug Attempt:
When I ran the same gui script with a sample script(sample_script) which prints number 1 to 5000, it was running fine. That means the flow of the script is ok.
But there is one major difference between test environment and my actual script run environment: that is my subprocess run script(say:- script_1) is actually a parent csh script which runs other scripts(say:- script1.1 and script 1.2) under it.
Hence Please note following points:

The execution halts when script1 has issued commands to launch script1.1
The sample_script(which prints number) is working fine though.

Debug Update:
I ran the following script as sample_script and noticed the following results:

set i = 450
while ($i > 1)
  echo i is $i
  set i = `expr "$i" - 1`
end 

By running the above example, i found that the output appears only after subprocess is complete.
However, In my case if i put i = 550, the terminal stays in wait state and output doesn’t appear(even after many minutes). Hence the process stuck.
The i = 550 number may be higher or lower for you.
When i am running i = 550, using print statements i found that the execution of sample_script stops at i = 98.
I am unable to figure out why!!

PLEASE do prompt me if you need anymore information.

  • 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-27T02:20:29+00:00Added an answer on May 27, 2026 at 2:20 am

    I’ve used tk for close to 20 years and haven’t noticed any problems with large amounts of text, though I don’t guess I’ve ever tried to load up more than a few 10’s of thousands of lines. Just how much data are you trying to show? Are you using a large number of tags and different fonts, or is this just plain text?

    Certainly, the whole GUI will become unresponsive if you’re spawning a subprocess and waiting for it to complete. Tk is single threaded, so while you’re waiting for a process to finish there’s no way for the event loop to run and thus your program will freeze. You need to make sure that whatever scheme you use to run the process and manage it’s output doesn’t block the event loop.

    My guess is, this isn’t a limitation of the text widget and switching to the canvas won’t help. The problem is probably in your code, but without seeing your code it’s impossible to come up with a solution.

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

Sidebar

Related Questions

Ever since I've been using an external monitor with my laptop, when I need
Need to know this so that i could send DTMF and that is going
I need to know about Epoll On linux System. Could you recommend manual or
I need to know how the performance of different XML tools (parsers, validators, XPath
I need to know how much space occupies all the databases inside an SQL
I need to know how to turn on Code Coverage when running TFS builds
I need to know when the memory will be allocated for a particular program.
I need to know, from within Powershell, if the current drive is a mapped
I need to know how I get the stream of the headers and footers
I need to know what internet connection is available when my application is running.

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.