def sortoutputwindow(contents: [str]): output = "" for item in contents: output += item + "\n" layout = [[sg.Text("I have sorted these files:")], [sg.MultilineOutput(output)], [sg.OK()]] window = sg.Window("Results", layout) window.Read() window.Close()
def getInputOutputWindow(titletext="Select File"): layout = [[sg.Text('Input File')], [sg.Input(), sg.FileBrowse(initial_folder=home)], [sg.Text('Output File')], [sg.Input(), sg.FileSaveAs(initial_folder=home)], [sg.OK(), sg.Cancel()]] window = sg.Window(titletext, layout) event, values = window.Read() return event, values
def rclonewindow(): layout = [[sg.Text("What is the Drive you want to access?")], [sg.Input("Drive")], [sg.Text("What is the folder you want to see?")], [sg.Input()], [sg.Cancel(), sg.OK()]] window = sg.Window("rclone", layout=layout) event, values = window.Read() window.Close() return event, values
def rcloneoutputwindow(contents: []): output = "" for item in contents: output += item.name + "\n" layout = [[sg.Text("Here are the contents:")], [sg.MultilineOutput(output)], [sg.OK()]] window = sg.Window("Results", layout) window.Read() window.Close()
def getInputWindow(titletext="Inputfile"): layout = [[sg.Text("Select a file to convert:")], [sg.Input(), sg.FileBrowse("Select File", initial_folder=home)], [sg.OK(), sg.Cancel()]] window = sg.Window(titletext, layout) event, values = window.Read() window.Close() return event, values
def getOutputWindow(titletext="Outputfile", prefill=""): layout = [[sg.Text("Where should it be saved?")], [ sg.Text("Save under:"), sg.Input(), sg.FileSaveAs(initial_folder=prefill) ], [sg.OK(), sg.Cancel()]] window = sg.Window(titletext, layout) event, values = window.Read() window.Close() return event, values
def getFolderInputWindow(titletext="Inputfolder", initial_folder=home): layout = [[sg.Text("Select a folder:")], [ sg.Input(), sg.FolderBrowse("Select Folder", initial_folder=initial_folder) ], [sg.OK(), sg.Cancel()]] window = sg.Window(titletext, layout) event, values = window.Read() window.Close() return event, values
], [ sg.Text('Threshold'), sg.Slider(range=(0, 10), orientation='h', resolution=1, default_value=3, size=(15, 15), key='threshold'), sg.T(' ', key='_THRESH_OUT_') ], [sg.Text(' ' * 8), sg.Checkbox('Use webcam', key='_WEBCAM_')], [sg.Text(' ' * 8), sg.Checkbox('Write to disk', key='_DISK_')], [sg.OK(), sg.Cancel(), sg.Stretch()], ] win = sg.Window('YOLO Video', default_element_size=(21, 1), text_justification='right', auto_size_text=False).Layout(layout) event, values = win.Read() if event is None or event == 'Cancel': exit() write_to_disk = values['_DISK_'] use_webcam = values['_WEBCAM_'] args = values win.Close()
], [ sg.Text('Threshold'), sg.Slider(range=(0, 10), orientation='h', resolution=1, default_value=3, size=(15, 15), key='threshold'), sg.T(' ', key='_THRESH_OUT_') ], [ sg.Text(' ' * 8), sg.Checkbox('Write output video to disk', key='_DISK_') ], [sg.OK(size=(100, 30)), sg.Stretch()], ] layout2 = [[ sg.Text('Extract Audio from different sources', size=(50, 1), font=('Any', 18), text_color='#1c86ee', justification='left') ], [ sg.Text('Path to input video'), sg.In(i_vid, size=(40, 1), key='inputSound'), sg.FileBrowse(size=(75, 30)) ], [
import PySimpleGUIQt as sg layout = [[ sg.Text("Some text of Row 1", font="DejaVu Sans 18", text_color="blue", background_color="green") ], [sg.OK(), sg.Cancel()]] window = sg.Window("Window Title", layout) while True: event, values = window.Read() if event in (None, "Cancel"): print("Cancel is pressed.") print("I will break now.") break window.Close()
def open_win2(): window.Hide() layout2 = [[sg.T("Your safe is opened.")], [sg.OK()]] win2 = sg.Window("windows 2", layout2) win2.read()
# https://www.raspberrypi.org/forums/viewtopic.php?t=219201 """ import PySimpleGUI27 as sg sg.Popup('Hello From PySimpleGUI!', 'This is the shortest GUI program ever!') """ #import PySimpleGUI as sg import PySimpleGUIQt as sg #import PySimpleGUIWeb as sg layout = [[sg.Text('Filename', text_color='red')], [sg.Input(), sg.FileBrowse()], [sg.OK(), sg.Cancel()]] #event, values = sg.Window('Get filename example').Layout(layout).Read() window = sg.Window('Get filename example').Layout(layout) # The Event Loop while True: event, values = window.Read() if event is None: break if event == 'OK': print(values[0])