Blank TK Window

S

Shamefaced

Hi,
Any reason why a blank Tk() window opens up when I run my code:
Code:
for run in range(RUNS):
waittime = Monitor2()
checkouttime = Monitor2()
totaltimeinshop = Monitor2()
checkout_aisle = Simulation.Resource(AISLES)
Simulation.initialize()
cf = Customer_Market()
Simulation.activate(cf, cf.run(), 0.0)
Simulation.simulate(until=CLOSING)


Histo = waittime.histogram(low=0.0, high=80, nbins=40)
plt = SimPlot()
plt.plotLine(Histo, xlab='Time (min)',ylab='Qty Customers',
title="Wait Time",
color="red", width=2,
smooth='True')
plt.mainloop()
 
W

woooee

Hi,
Any reason why a blank Tk() window opens up when I run my code:
Code:
for run in range(RUNS):
    waittime = Monitor2()
    checkouttime = Monitor2()
    totaltimeinshop = Monitor2()
    checkout_aisle = Simulation.Resource(AISLES)
    Simulation.initialize()
    cf = Customer_Market()
    Simulation.activate(cf, cf.run(), 0.0)
    Simulation.simulate(until=CLOSING)

    Histo = waittime.histogram(low=0.0, high=80, nbins=40)
    plt = SimPlot()
    plt.plotLine(Histo, xlab='Time (min)',ylab='Qty Customers',
                      title="Wait Time",
                      color="red", width=2,
                      smooth='True')
plt.mainloop()

1. you no longer have a toplevel/root "plt" once you replace "plt"
with
    plt = SimPlot()
2. the SimPlot widget in never placed in Tkinter. This is usually
done with pack() or grid()

So start out with a Tkinter tutorial so you understand the basics.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top