Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #25512 > unrolled thread
| Started by | Shamefaced <manengstudent@gmail.com> |
|---|---|
| First post | 2012-07-17 09:32 -0700 |
| Last post | 2012-07-17 09:47 -0700 |
| Articles | 2 — 2 participants |
Back to article view | Back to comp.lang.python
Blank TK Window Shamefaced <manengstudent@gmail.com> - 2012-07-17 09:32 -0700
Re: Blank TK Window woooee <woooee@gmail.com> - 2012-07-17 09:47 -0700
| From | Shamefaced <manengstudent@gmail.com> |
|---|---|
| Date | 2012-07-17 09:32 -0700 |
| Subject | Blank TK Window |
| Message-ID | <250fc186-0fa9-481c-8b2b-44e77921e6d8@googlegroups.com> |
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()
[toc] | [next] | [standalone]
| From | woooee <woooee@gmail.com> |
|---|---|
| Date | 2012-07-17 09:47 -0700 |
| Message-ID | <b68f4542-f7ab-4de5-87f1-9b508d91edc9@nw7g2000pbb.googlegroups.com> |
| In reply to | #25512 |
On Jul 17, 9:32 am, Shamefaced <manengstud...@gmail.com> wrote: > 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.
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web