April 2018
Beginner
552 pages
13h 58m
English
#!/usr/bin/python3 # graphicmenu.py import tkinter as tk from subprocess import call import threading #Define applications ["Display name","command"] leafpad = ["Leafpad","leafpad"] scratch = ["Scratch","scratch"] pistore = ["Pi Store","pistore"] app_list = [leafpad,scratch,pistore] APP_NAME = 0 APP_CMD = 1 class runApplictionThread(threading.Thread): def __init__(self,app_cmd): threading.Thread.__init__(self) self.cmd = app_cmd def run(self): #Run the command, if valid try: call(self.cmd) except: print ("Unable to run: %s" % self.cmd) class appButtons: def __init__(self,gui,app_index): #Add the buttons to window btn = tk.Button(gui, ...