Answers for "open tkinter and cli"

0

open tkinter and cli

import threading
from tkinter import *

class GUI:
    def __init__(self):
        # Put whatever you want for the Tkinter window.
        self.window = Tk()

        Label(self.window, text="Tkinter GUI").pack()

        mainloop()

class CLI:
    def __init__(self):
        # Put whatever you wanted for the shell script.
        while True:
            inp = input("Select...")
            if inp == "1":
                print("1")
            elif inp == "2":
                print("2")
            else:
                print("error")

Thread1 = threading.Thread(target=GUI)
Thread1.start()

Thread2 = threading.Thread(target=CLI)
Thread2.start()
Posted by: Guest on October-20-2021

Python Answers by Framework

Browse Popular Code Answers by Language