Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Python 

How to print cli script into the tkinter gui window

Hi, i want to make in python 2.7 with Tkinter module to print the function or other script is made in cli to window (sorry for my bad english)
Im new in Tkinter module so i just want to make something like this in gui
https://imgur.com/a/L043n
Only to print my function or my script there like if user click the button the script will run in gui like in cli
pyQT is better for this and comes with designer.
in thinter simply use button widget ... here is the example i found.

Code
import Tkinter as tk

counter = 0
def counter_label(label):
  counter = 0
  def count():
    global counter
    counter += 1
    label.config(text=str(counter))
    label.after(1000, count)
  count()


root = tk.Tk()
root.title("Counting Seconds")
label = tk.Label(root, fg="dark green")
label.pack()
counter_label(label)
button = tk.Button(root, text='Stop', width=25, command=root.destroy)
button.pack()
root.mainloop()
[Image: V9Gredc.png]


Possibly Related Threads...
Thread / Author Replies Views Last Post
by HackersNov 11, 2025 09:42 AM 0 201 Nov 11, 2025 09:42 AM
Last Post: Hackers
by HackersDec 11, 2024 05:11 PM 21 524 Dec 11, 2024 05:11 PM
Last Post: padrino
by HackersDec 11, 2024 08:31 AM 23 679 Dec 11, 2024 08:31 AM
Last Post: Hackers