Misol - from Tkinter import *
- import math
- def hard_job():
- x = 1000
- while True:
- x = math.log(x) ** 2.8
- root.update()
- root=Tk()
- button = Button()
- button.pack()
- root.after(500, hard_job)
- root.mainloop()
eval va evalfile - TCL kodini bajarish uchun ikkita noaniq funktsiya.
- Eval - TCL dasturlash tilida dasturni amalga oshirishga imkon beradi va faylga yozilgan kodni bajarish uchun qulay. Argumentlar navbati bilan fayl yo'lidir. Ushbu vazifalar TCL da yozilgan qo'shimcha modullardan foydalanganda foydalidir.
Misol - from Tkinter import *
- root=Tk()
- root.eval('package require tile; ttk::style theme use clam')
- root.eval('ttk::button .b -text {ttk button}; pack .b')
- root.mainloop()
Toplevel |