Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

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()
Comment

PREVIOUS NEXT
Code Example
Python :: python remove middle of string 
Python :: queryset.raw() in django rest framework joining tables 
Python :: Python turtle (built in shape) image size 
Python :: jupyter notebook print string with variables 
Python :: create file and store output python 
Python :: reorder columns in python 
Python :: stellargraph python 
Python :: is not and != difference in python 
Python :: paystack python 
Python :: Hewwo wowwd 
Python :: ternary operator using dictionary in Python 
Python :: the code panda 
Python :: assertRaises property 
Python :: messe graphen erstellen python 
Python :: sns plot standard form 
Python :: pycharm display info of function 
Python :: how to add a list to a list python 
Python :: run a python file from another python file 
Python :: numpy array to int type 
Python :: python encryption program 
Python :: print list vertically python 
Python :: dataframe 
Python :: do while in python 
Python :: bounding box in python 
Python :: how to check if a value is nan in python 
Python :: pandas to excel 
Python :: how to convert lower case to upper case in python 
Python :: python value error 
Python :: fraction in python 
Python :: django or flask 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =