Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 On the spot counter
#11
(Nov-28-2019, 11:28 AM)Astrikor Wrote: cmd does work, but is clunky to run a file.
I would rather run from an IDE.
Any other ideas?

I wouldn't call running file from terminal a clunky way Smile

I suggest to try VS Code. To run a file in terminal just 'CTRL + <' (default setting of "command": "python.execInTerminal") while in editor.
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy

Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Quote
#12
Thanks Guys.

On second thoughts I will use a simple GUI like tkinter for this.

Thanks again

Astrikor
Quote
#13
I'm thinking tkinter night be do the job, something like

from tkinter import *
import time
for i in range (15):
    Count = "Count : ",i
    window = Tk()
    lbl = Label(window, text=Count)
    lbl.grid(column=0, row=0)
    window.mainloop()
    time.sleep(1)
Trying to overwrite the window label ?
Quote
#14
Unfortunately my tkinter code does not update the count automatically.
Can anyone advise?

Many thanks
Astrikor

Finally cracked it.
from tkinter import *
import time

root = Tk()
var = StringVar()
var.set('')
Label(root, textvariable = var).pack()
for i in range(15):
    Count = "Count ",str(i)
    time.sleep(1)
    var.set(Count)
    root.update()
This works ok.

Thanks guys!
Astrikor
Quote

Top Page

Forum Jump:


Users browsing this thread: 1 Guest(s)