return 'Peso Normal' elif(imc >= 25 and imc <= 29.9): return 'Sobrepeso' elif(imc >= 30 and imc <= 34.9): return 'Obesidade Grau I' elif(imc >= 35 and imc <= 39.9): return 'Obesidade Grau II' elif(imc >= 40): return 'Obesidade Grau III ou Mórbida' sg.theme('Default1') layout = [ [sg.Text('Calcular IMC', font=('Helvetica', 25))], [sg.Text('Peso '), sg.Input(key='peso', size=(10, 1))], [sg.Text('Altura'), sg.Input(key='altura', size=(10, 1))], [sg.Text('IMC'), sg.Input(default_text='', disabled=True, key='IMC')], [sg.Text('Resultado: ', size=(30,1), key='resultado')], [sg.Button('Calcular', size=(10,2)), sg.Button('Limpar', size=(10,2))], [sg.Text('Desenvolvido por Brenno Luan')] ] window = sg.Window('Cálculo do IMC', layout) while True: event, values = window.read() if event == sg.WIN_CLOSED: break
from urllib import request from lxml import etree from bs4 import BeautifulSoup from datetime import datetime, timedelta import csv import random import time import logging import PySimpleGUI as sg from fake_useragent import UserAgent values = ["a", "b", "c"] layout = [[sg.Text('Start quarter(\'mm_dd_yyyy\',eg:01_31_2018):')], [sg.Input()], [sg.Text('End quarter(eg,\'mm_dd_yyyy\'):')], [sg.Input()], [sg.Text('One keyword(eg:bond,China...):')], [sg.Input()], [sg.RButton('Read'), sg.Exit()]] window = sg.Window('Persistent GUI Window').Layout(layout) while True: event, start_end = window.Read() if event is None or event == 'Exit': break else: print(start_end) values[0] = start_end[0] values[1] = start_end[1] values[2] = start_end[2] window.Close()
justification='center', size=(10, 1)) ], [sg.Spin(values=('Spin Box 1', '2', '3'), initial_value='Spin Box 1')], [sg.Spin(values=('Spin Box 1', '2', '3'), initial_value='Spin Box 2')], [sg.Spin(values=('Spin Box 1', '2', '3'), initial_value='Spin Box 3')] ] layout = [[sg.Menu(menu_def, tearoff=True)], [ sg.Text('SETHA video to mp3 converter', size=(30, 1), justification='center', font=("Helvetica", 25), relief=sg.RELIEF_RIDGE) ], [sg.Image(filename=r'logo.png', size=(200, 200))], [sg.Input(key='_FILES_'), sg.FilesBrowse()], [sg.Text('_' * 80)], [sg.Submit(tooltip='Click to submit this form'), sg.Cancel()]] window = sg.Window('SETHA video to mp3 converter', layout, default_element_size=(40, 1), grab_anywhere=False, icon=r'logo_icon.ico') event, values = window.read() window.close() list_val = list(values.values()) print(list_val[1])
LAYOUT = [[sg.Image(key='-IMAGE-')], [ sg.Checkbox('Correct aspect ratio', key='-RESIZE-', enable_events=True), sg.Button('Reload', key='-RELOAD-'), sg.Button('Save', key='-SAVE-'), sg.Exit() ], [ sg.Checkbox('Auto-reload every (seconds):', key='-AUTORELOAD-', default=True), sg.Input(DELTA, key='-DELTA-', size=(3, 1), justification='right'), sg.Button('Set', key='-UPDATE_DELTA-') ]] def main(layout): """Run event loop.""" window = sg.Window('Spacestills', layout, finalize=True) current_still = refresh(window) delta = DELTA next_reload_time = datetime.now() + timedelta(seconds=delta) while True: event, values = window.read(timeout=100)
def main(): system_msg = sg.Multiline("msg: please fill in the blanks\n", text_color="gray", size=(60, 10), autoscroll=True) password_input = sg.Input("", disabled=True) ok_button = sg.OK() layout = [ [ sg.Text("warning: Do not forget backup original wallet!", text_color="red") ], [ sg.Text("you need set password below if encrypt wallet"), sg.Checkbox("encrypted", enable_events=True, default=False), ], [password_input], [sg.Text("wallet.dat"), sg.Input(), sg.FileBrowse()], [ sg.Text("endpoint"), sg.Input("http", size=(10, None)), sg.Text("://"), sg.Input("127.0.0.1", size=(10, None)), sg.Text(":"), sg.Input("3000", size=(6, None)) ], [ sg.Text("authentication"), sg.Input("user", size=(20, None)), sg.Text(":"), sg.Input("password", size=(20, None)), ], [ sg.Text("human readable part(hrp)"), sg.Input("test", size=(20, None)), ], [sg.Text("system message")], [system_msg], [ok_button, sg.CloseButton("close")], ] window = sg.Window("kumacoin 1.0⇒2.0 swapper (%s)" % __version__, layout, debugger_enabled=False) window.read_call_from_debugger = True while True: try: event, values = window.read() if event in (None, 'close'): # if user closes window or clicks cancel break if event == 0: # checkbox password_input.update(disabled=not values[event]) continue if event != "OK": system_msg.update("warning unknown event `%s`\n" % event, append=True) continue # setup params password = values[1] if values[0] else "" system_msg.update("msg: password=`%s`\n" % password, append=True) wallet_path = values[2] system_msg.update("msg: wallet=`%s`\n" % wallet_path, append=True) url = "%s://%s:%s@%s:%s/private/importprivatekey" \ % (values[3], values[6], values[7], values[4], values[5]) system_msg.update("msg: url=`%s`\n" % url, append=True) hrp = values[8] system_msg.update("msg: hrp=`%s`\n" % hrp, append=True) # check if not os.path.exists(wallet_path): system_msg.update("error: not found wallet.dat\n", append=True) continue if not os.path.isfile(wallet_path): system_msg.update("error: path is not file\n", append=True) continue # search threading.Thread(target=task, args=(password, wallet_path, hrp, url, system_msg, ok_button)).start() except Exception as e: system_msg.update("error: `%s`\n" % str(e), append=True)
plt.close('all') #%% PySimpleGUI sg.theme('SystemDefaultForReal') # sets GUI theme to Windows default colors layout = [ [ sg.Frame( title='Selection', element_justification='l', layout=[ [ sg.Text('File:'), sg.Input(key='File', size=(29, 1), enable_events=True), sg.FileBrowse(key='Browse'), sg.Button('OK', disabled=True) ], [ sg.Text('Status :', size=(16, 1), text_color='darkgray', justification='r'), sg.Text('Waiting for user input...', key='Status', size=(20, 1), text_color='darkgray', justification='l') ], # status shows last action completed [
listDurStr2 = ['S', 'D', 'W', 'M', 'Y'] #!use with integer prefix listBarSizes = [ '1 secs', '5 secs', '10 secs', '15 secs', '30 secs', '1 min', '2 mins', '3 mins', '5 mins', '10 mins', '15 mins', '20 mins', '30 mins', '1 hour', '2 hours', '3 hours', '4 hours', '8 hours', '1 day', '1W', '1M' ] listWhatToShows = [ 'TRADES', 'MIDPOINT', 'BID', 'ASK', 'BID_ASK', 'ADJUSTED_LAST', 'HISTORICAL_VOLATILITY', 'OPTION_IMPLIED_VOLATILITY', 'REBATE_RATE', 'FEE_RATE', 'YIELD_BID', 'YIELD_ASK', 'YIELD_BID_ASK', 'YIELD_LAST' ] layout = [ [ sg.Input(default_text="RELIANCE", key='_Symbol_', tooltip='Exact IBKR symbol'), sg.Combo(listSecTypes, key='_SecType_', auto_size_text=True, tooltip='STK = Stock, CASH = Forex, IND = Index'), sg.Combo(listExchanges, key='_Exchange_', auto_size_text=True), sg.Combo(listCurrencies, key='_Currency_', auto_size_text=True) ], [ sg.Button('Qualify'), sg.Text('Qualified Security: '), sg.Text('<None>', size=(15, 1), key='_OUTPUT_') ], [ sg.Input(default_text=1, key='_DurStr1_', size=(3, 1)),
gui.Combo(list(range(8, 17)), default_value=8, key="size", size=(6, 10), pad=(10, 10)) ], [ gui.Text("Strength", pad=(80, 0)), gui.Combo(["Weak", "Midcore", "Strong"], default_value="Midcore", key="strength", size=(10, 3)) ], [ gui.Input(key="pass", size=(16, 3), default_text="P@S$C0D3", pad=(150, 20)) ], [gui.Button("Generate", focus=True, size=(10, 2), pad=(150, 10))]] #Initialize the gui Window window = gui.Window("PassWordGenerator", layout, size=(400, 250)) # Requirements of the password small = 'abcdefghijklmnopqrstuvwxyz' capital = small.upper() numbers = '1234567890' symbols = '_!@#$%^&*+-><' # now the gui implementation begins while True: event, values = window.read()
log_file = 'run_log.txt' logging.basicConfig( level=logging.DEBUG, format='%(name)s, %(asctime)s, [%(levelname)s], %(message)s', filename=log_file, filemode='w') buffer = '' ch = Handler() ch.setLevel(logging.INFO) logging.getLogger('').addHandler(ch) layout = [ [sg.Text('Number:'), sg.Input(key='input')], [sg.Button('Run')], [sg.Output(size=(100, 10), key='log')], [sg.Button('Exit')], ] window = sg.Window('Window Title', layout) while True: # Event Loop event, values = window.read() if event == sg.WIN_CLOSED or event == 'Exit': break if event == 'Run': logging.info('Running...') window.close()
#!/usr/bin/env python import PySimpleGUI as sg # Demonstrates a number of PySimpleGUI features including: # Default element size # auto_size_buttons # Button # Dictionary return values # update of elements in form (Text, Input) layout = [ [sg.Text('Enter Your Passcode')], [sg.Input('', size=(10, 1), key='input')], [sg.Button('1'), sg.Button('2'), sg.Button('3')], [sg.Button('4'), sg.Button('5'), sg.Button('6')], [sg.Button('7'), sg.Button('8'), sg.Button('9')], [sg.Button('Submit'), sg.Button('0'), sg.Button('Clear')], [ sg.Text('', size=(15, 1), font=('Helvetica', 18), text_color='red', key='out') ], ] window = sg.Window('Keypad',
import PySimpleGUI as sg from captcha.image import ImageCaptcha from random import randint as rd image = ImageCaptcha(width=280, height=90) alphabet = 'abcdefghijklmnopqrstuvwxyz0123456789' captcha_text = '' sg.theme('DefaultNoMoreNagging') layout = [ [sg.Text('Responda o captcha abaixo')], [sg.Image(key='captcha_img')], [ sg.Input('', size=(8, 1), key='captcha'), sg.Button('Refresh', key='refresh'), sg.Button('Ok', key='send') ], ] window = sg.Window('Captcha', layout, finalize=True) def captcha_generator(): global captcha_text captcha_text = '' for each_letter in range(6): if rd(0, 1) == 0: captcha_text += alphabet[rd(0, len(alphabet) - 1)] else: captcha_text += alphabet[rd(0, len(alphabet) - 1)].upper()
import PySimpleGUI as sg """ Demo 1-line Sudoku Board A silly display of what 1 line of PySimpleGUI is capable of producing by utilizing the power of Python. The power isn't a PySimpleGUI trick. The power is Python List Comprehensions and using them in your layout. Copyright 2021 PySimpleGUI """ sg.Window('Sudoku', [[sg.Frame('', [[sg.Input(justification='r', size=(3,1)) for col in range(3)] for row in range(3)]) for frame_col in range(3)] for frame_row in range(3)], use_custom_titlebar=True).read()
# create formatter formatter = logging.Formatter( '%(asctime)s - %(name)s - %(levelname)s - %(message)s') # add formatter to ch ch.setFormatter(formatter) # add ch to logger logger.addHandler(ch) ''' Example of wizard-like PySimpleGUI windows ''' layout = [[ sg.Text('Window 1'), ], [sg.Input('')], [sg.Text('', size=(20, 1), key='-OUTPUT-')], [sg.Button('Next >'), sg.Button('Exit')]] window1 = sg.Window('Window 1', layout) window3_active = window2_active = window4_active = False while True: if not window2_active: event1, values1 = window1.read() if event1 is None or event1 == 'Exit': break window1['-OUTPUT-'].update(values1[0]) if not window2_active and event1 == 'Next >': window2_active = True
def create_main_window(theme): sg.theme(theme) sg.set_options( font = FONT_MTSERRAT, element_padding=(0, 0) #button_color=('Blue', 'White') ) # Right Click Menu layout rc_menu = ['RightClickMenu', ['Tema', THEME_MENU[1], 'Versão']] # main layout layout = [ [ # no default title bar, this is the custom one sg.Text('Assinaturas', font=FONT_GRANDSTANDER, pad=((10, 0), (0, 0))), sg.Push(), # sg.Image( # 'resources/img/cross_16px.png', # enable_events=True, # key = '-CLOSE-', # ) sg.Image(source='resources/img/logo.png', subsample=14, pad=((0, 20), (1, 5))) ], [sg.HorizontalSeparator(pad=((0, 0), (0, 10)))], [ sg.Text('Nome *'), sg.Push(), sg.Input(size=(32, 1), pad=((0, 0), (0, 5)), key='-NOME-') ], [ sg.Text('Setor/Cargo *'), sg.Push(), sg.Input(size=(32, 1),pad=((0, 0), (0, 5)), key='-SETOR-') ], [ sg.Text('Telefone particular'), sg.Push(), sg.Input(size=(32, 1), pad=((0, 0), (0, 5)),key='-TELEFONE1-', tooltip="Opcional, se ficar em branco será selecionado a assinatura com apenas 1 ícone de telefone.") ], [ sg.Text('Telefone secundário'), sg.Push(), sg.Input(size=(32, 1), pad=((0, 0), (0, 5)), key='-TELEFONE2-', tooltip="Opcional, caso fique vazio será usado o número da empresa automaticamente.") ], [ sg.Text('Email *'), sg.Push(), sg.Input(size=(32, 1), pad=((0, 0), (0, 5)), key='-EMAIL-') ], [ sg.Button('Gerar nova assinatura', size=(22, 1), key='-GERAR-', pad=(0, 5)), sg.Push(), sg.Button('Gerar assinaturas em massa', size=(22, 1), key='-GERAR_MASSA-') ] ] return sg.Window( title='Assinaturas', layout=layout, return_keyboard_events=True, grab_anywhere=True, right_click_menu=rc_menu, icon='resources\img/assinatura_64px.ico' #no_titlebar = True, )
choice1.update(text=str(a)) choice2.update(text=str(b)) input_choice = "" while input_choice not in ["A", "B"]: event, values = window.read() if event == SAVE: np.save( input_file.absolute().parent.joinpath( f"saved_{input_file.name}"), sorting_matrix) input_choice = event return -1 if input_choice == "A" else 1 load_file_layout = [[ sg.Text('Input', size=(8, 1)), sg.Input(), sg.FileBrowse() ], [sg.Button("Sort ascending"), sg.Button("Sort descending")]] event, load_file_values = sg.Window("Comparatron3000", load_file_layout).read(close=True) rev = True if event == "Sort ascending" else False input_file = pathlib.Path(load_file_values[0]) if input_file.suffix == ".save": sorting_matrix = np.load(input_file) elif input_file.suffix == ".txt": with open(input_file) as input_fh: unsorted_list = input_fh.read().strip().split("\n") unsorted_list_len = len(unsorted_list) sorting_matrix = np.zeros((unsorted_list_len, unsorted_list_len)) else:
with open(nom, 'w') as f: json.dump(d, f) # def cargar_datos(nom): # with open(nom,'r') in f: # lista = f.read() # return lista def actualizar_listado(listbox, lista): listbox.Update(map(lambda x: "{}: {}".format(x[0], x[1]), lista)) layout = [[sg.Text('Temperatura:'), sg.Input(key='temperatura')], [sg.Text('Humedad:'), sg.Input(key='humedad')], [sg.Listbox(values=[], key='Datos', size=(60, 10))], [sg.Button('Añadir'), sg.Button('Guardar')]] window = sg.Window('Datos de la temperatura y humedad').Layout(layout) window.Finalize() lista = [] while True: event, values = window.Read() if event is None: break if event is 'Añadir': lista.append((values['temperatura'], values['humedad'])) actualizar_listado(window.FindElement('Datos'), lista)
event, values = window.read(timeout=100) if event != '__TIMEOUT__': print(event, values) if event == sg.WIN_CLOSED or event == 'Exit': break await asyncio.sleep(.1) async def main(): loop = asyncio.get_event_loop() job1 = loop.create_task(task1()) job2 = loop.create_task(task2()) job3 = loop.run_in_executor(None, blocking_task) job4 = loop.create_task(test_gui()) await job1 await job2 await job3 await job4 if __name__ == "__main__": ct = time.time() layout = [[sg.Text('Persistent window')], [sg.Input(key='-IN-')], [sg.Button('Read'), sg.Exit()]] window = sg.Window('Window that stays open', layout) asyncio.run(main()) print(f'Total runtime {time.time() - ct}')
def input_window(): # Create an Input Window input_layout = [ # Define layout of input window. [ Sg.Text( "The width and height are the two values used to make the 2D gym in the simulation." ) ], [ Sg.Text( "The number of simulations is determined by the length and radius of the softball." ) ], [ Sg.Text( "If you are unsure of what to do, just use the default values already entered" ) ], [ Sg.Text( "and press the Q key to start the auto simulation. If you don't want to wait a long time" ) ], [ Sg.Text( " change the length of the gym to a smaller number. Also, when the simulation opens," ) ], [Sg.Text("try pressing the ` key (top left of keyboard).")], [ Sg.Text("Units: "), Sg.Radio("Meters", group_id='units', key='m', default=True), Sg.Radio("Pixels", group_id='units', key='p') ], [ Sg.Text("Width of Gym: "), Sg.Input("15", key='width', size=(5, 1)), Sg.Text("Height of Gym"), Sg.Input("7", key='height', size=(5, 1)) ], [ Sg.Text("Length of Gym: "), Sg.Input("28", key='length', size=(5, 1)) ], [ Sg.Text("Ball Radius: "), Sg.Input("0.35", key='softball', size=(5, 1)) ], [ Sg.Text( "If you entered a ball radius less than 0.35m (350px) then select the multiple simulations per section" " option below.") ], [ Sg.Text("Multiple Simulations Mode:"), Sg.Radio("On", group_id='multi_mode', key='multi_on'), Sg.Radio("Off", group_id='multi_mode', key='multi_off') ], [Sg.Button("Submit", key='submit', bind_return_key=True), Sg.Cancel()] ] input_win = Sg.Window('Input', input_layout) while True: event, values = input_win.read() if event in (None, 'Cancel'): # If user closes window, kill program. sys.exit() if event == 'submit': input_win.close() if float(values['softball']) == 3.1415: exec(open('Setup.py', encoding="utf-8").read(), globals()) elif values[ 'm']: # If metric, convert values to pixels, otherwise only calculate # of simulations needed. return [ int(float(values['width']) * 1000), int(float(values['height']) * 1000), int( float(values['length']) / (2 * float(values['softball']))), int(float(values['softball']) * 1000), values['multi_on'] ] return [ int(values['width']), int(values['height']), int(float(values['length']) / (2 * float(values['softball']))), int(values['softball']), values['multi_on'] ]
#!/usr/bin/env python import PySimpleGUI as sg """ Demo of how to combine elements into your own custom element """ sg.set_options(element_padding=(0, 0)) # --- Define the Compound Element. Has 2 buttons and an input field --- # NewSpinner = [ sg.Input('0', size=(3, 1), font='Any 12', justification='r', key='-SPIN-'), sg.Column([[ sg.Button('▲', size=(1, 1), font='Any 7', border_width=0, button_color=(sg.theme_text_color(), sg.theme_background_color()), key='-UP-') ], [ sg.Button('▼', size=(1, 1), font='Any 7', border_width=0, button_color=(sg.theme_text_color(), sg.theme_background_color()), key='-DOWN-') ]]) ] # --- Define Window --- # layout = [[sg.Text('Spinner simulation')], NewSpinner, [sg.Text('')],
import PySimpleGUI as sg # Design pattern 1 - First window does not remain active layout = [[ sg.Text('Window1'),], [sg.Input()], #[sg.Text('', key='_OUTPUT_')], [sg.Button('Launch 2')]] win1 = sg.Window('Window1', layout) win2_active = False while True: event1, values1 = win1.read() if event1 is None: break if event1 == 'Launch 2' and not win2_active: win2_active = True win1.hide() layout2 = [ [sg.Text('Window2')], [sg.Button('Exit')] ] win2 = sg.Window('Window2', layout2) while True: event2, values2 = win2.read() if event2 is None or event2 == 'Exit': win2.close() win2_acive = False
def __init__(self): layout = [[sg.Text('Origem'), sg.Input()], [sg.Text('Destino'), sg.Input()], [sg.Button('Buscar Rota')], [sg.Output(size=(80, 5))]] self.janela = sg.Window('Informe sua rota').layout(layout)
import PySimpleGUI as sg sg.theme('BluePurple') layout = [[ sg.Text('Your typed chars appear here:'), sg.Text(size=(15, 1), key='-OUTPUT-') ], [sg.Input(key='-IN-')], [sg.Button('Show'), sg.Button('Exit')]] window = sg.Window('Pattern 2B', layout) while True: # Event Loop event, values = window.read() print(event, values) if event == sg.WIN_CLOSED or event == 'Exit': break if event == 'Show': # Update the "output" text element to be the value of "input" element window['-OUTPUT-'].update(values['-IN-']) window.close()
sg.InputCombo(('input', 'Dense'), size=(15, 1)), sg.InputText('50', size=(5, 1)) ], [sg.Text('重みの初期値')], [sg.InputCombo(('Xavier', 'He'), size=(15, 1))], [sg.Text('活性化関数')], [sg.InputCombo(('relu', 'sigmoid', 'liner'), size=(15, 1))], [sg.Text('損失関数')], [sg.InputCombo(('mean_squared_error'), size=(20, 1))], [sg.Text('評価関数')], [sg.InputCombo(('r2', 'rmse'), size=(15, 1))], ] NuralNet = [ [sg.Text('学習用データ')], [sg.Input(size=(30, 1)), sg.FileBrowse(key='-orgLRN-')], [sg.Text('学習用ラベル')], [sg.Input(size=(30, 1)), sg.FileBrowse(key='-orgTrg-')], [sg.Text('Validation用データ')], [sg.Input(size=(30, 1)), sg.FileBrowse(key='-valRLN-')], [sg.Text('Validation用ラベル')], [sg.Input(size=(30, 1)), sg.FileBrowse(key='-valTrg-')], [ sg.Radio('標準化', 'feature', size=(10, 1), key='-feature_0-'), sg.Radio('正規化', 'feature', size=(10, 1), key='-feature_1-'), sg.Radio('両方', 'feature', size=(10, 1), key='-feature_2-') ],
import PySimpleGUI as sg col1 = [[sg.Text('Név:')], [sg.Text('Telefonszám:')], [sg.Text('Életkor')], [sg.Button('Keres')]] col2 = [[sg.Input(key='Név')], [sg.Input(key='Telefon')], [sg.Input(key='Életkor')], [sg.Button('Ment')]] layout = [[sg.Column(col1), sg.Column(col2)]] window = sg.Window('Randi', layout) while True: event, values = window.read() print(event, values) if event in (None, 'Exit'): break if event in ('Ment'): nev = values['Név'] telefon = values['Telefon'] eletkor = values['Életkor'] #print(nev, telefon, eletkor) with open('randi2.csv', 'a', encoding='UTF-8') as f: print(f'{nev}; {telefon};{eletkor}', file=f) if event in ('Keres'): nev = values['Név'] telefon = values['Telefon'] eletkor = values['Életkor'] nev = eredmeny[0][0] telefon = eredmeny[0][1]
""" Evaluating code from https://github.com/PySimpleGUI/PySimpleGUI Required to work: PySimpleGUI availability Install with: pip3 install pysimplegui """ import PySimpleGUI as sg # Define the window's contents layout = [[sg.Text("What's your name?")], [sg.Input(key='inputField')], [sg.Text(size=(40, 1), key='outputLabel')], [sg.Button('Ok'), sg.Button('Quit')]] # Create the window window = sg.Window('Interactive Hello World', layout) # Display and interact with the Window using an Event Loop while True: event, values = window.read() # See if user wants to quit or window was closed if event == sg.WINDOW_CLOSED or event == 'Quit': break # Output a message to the window window['outputLabel'].update('Hello ' + values['inputField'] + "! Thanks for trying PySimpleGUI", text_color='yellow') # Finish up by removing from the screen window.close()
'IB', 'IBPEAK', 'IRMSA', 'IRMSB', 'IRQENA', 'IRQENB', 'IRQSTATA', 'IRQSTATB', 'LAST_ADD', 'LAST_OP', 'LAST_RWDATA', 'LCYCMODE', 'LINECYC', 'OILVL', 'OVLVL', 'PERIOD', 'PFA', 'PFB', 'PGA_IA', 'PGA_IB', 'PGA_V', 'RENERGYA', 'RENERGYB', 'RSTIAPEAK', 'RSTIBPEAK', 'RSTIRQSTATA', 'RSTIRQSTATB', 'RSTVPEAK', 'SAGCYC', 'SAGLVL', 'SETUP_REG', 'UNLOCK_REG', 'V', 'VA_NOLOAD', 'VAR_NOLOAD', 'VERSION', 'VPEAK', 'VRMS', 'VRMSOS', 'WPHCALA', 'WPHCALB', 'WRITE_PROTECT', 'ZXTOUT'] shed_state = ['Current', 'Deferred'] shed_days = ['Weekdays', 'Saturday', 'Sunday', 'Holiday'] sg.theme('DarkAmber') # Add a touch of color # All the stuff inside your window. l = [] for i in range(24): l.append(sg.Text('{:02}'.format(i))) l.append(sg.Input(key=f'sh-{i * 2}', size=(1, 1))) l.append(sg.Input(key=f'sh-{i * 2 + 1}', size=(1, 1))) layout = [ [sg.Text('port', size=(10, 1)), sg.Input(key='port', default_text=default_port, size=(20, 1))], [sg.Text('Dev addr', size=(10, 1)), sg.Input(key='addr', default_text='112609312', size=(20, 1))], [sg.Text('Password', size=(10, 1)), sg.Input(key='pass', default_text='', size=(20, 1))], [sg.Input(key='factory mode', size=(32, 1)), sg.Button('Get fact state'), sg.Button('Set factory mode'), sg.Button('Reset factory mode')], [sg.Text('ADE params')], [sg.Text('Choose param'), sg.InputCombo(all_vals, size=(20, 10), default_value=all_vals[0])], [sg.Text('bin dec hex')], [sg.Input(key='bin', size=(32, 1)), sg.Input(key='dec', size=(15, 1)), sg.Input(key='hex', size=(15, 1))], [sg.Button('Set'), sg.Button('Get'), sg.Button('Clear')], [sg.Text('Date and time')], [sg.Input(key='hour', size=(2, 1)), sg.Input(key='min', size=(2, 1)), sg.Input(key='sec', size=(2, 1)), sg.Button('Get time'), sg.Button('Set time'), sg.Button('Set system time')],
sg.set_options(element_padding=(0, 0)) layout = [[ sg.Text('User:'******'User 1', 'User 2'), size=(20, 1)), sg.Text('0', size=(8, 1)) ], [ sg.Text('Customer:', pad=((3, 0), 0)), sg.OptionMenu(values=('Customer 1', 'Customer 2'), size=(20, 1)), sg.Text('1', size=(8, 1)) ], [ sg.Text('Notes:', pad=((3, 0), 0)), sg.Input(size=(44, 1), background_color='white', text_color='black') ], [ sg.Button('Start', button_color=('white', 'black')), sg.Button('Stop', button_color=('gray50', 'black')), sg.Button('Reset', button_color=('white', '#9B0023')), sg.Button('Submit', button_color=('gray60', 'springgreen4')), sg.Button('Exit', button_color=('white', '#00406B')) ]] window = sg.Window("Borderless Window", layout, default_element_size=(12, 1), text_justification='r', auto_size_text=False,
import PySimpleGUI as sg sg.theme('Dark Blue 3') # please make your creations colorful layout = [[sg.Text('Filename')], [sg.Input(), sg.FileBrowse()], [sg.OK(), sg.Cancel()]] window = sg.Window('Get filename example', layout) event, values = window.read() window.close()
fileNames.append(saveQuery(sysdict, shortName, queryString, modelName)) return fileNames # # MAIN LAYOUT # # A separator of width w def sep(w): return sg.Text("_"*w, font=("Arial", 8)) verification_layout = [ ## GENERATE MODEL ## [sg.Text('Verification', key="labelGenerate", font=header_font)], [sg.Button('Create UPPAAL model', key='generateUPPAAL', disabled=True), sg.Button('Preview', disabled=True, font=font)], [sg.Input('', key='txtUPPAALFile', font=font, disabled=True)], ## VERIFY MODEL ## [sep(100)], [sg.Button(QUERIES[0][0], key='btnDeadlines', size=(30,1), disabled=True), sg.Text("Not checked", key='labelDeadlines', size=(30,1), justification='right', font=font), sg.Input('hmm', key="txtDeadlinesQuery", visible=False)], [sg.Button(QUERIES[1][0], key='btnQueues', size=(30,1), disabled=True), sg.Text("Not checked", key='labelQueues', size=(30,1), justification='right', font=font), sg.Input('hmm', key="txtQueuesQuery", visible=False)], [sg.Button(QUERIES[2][0], key='btnDeadlock', size=(30,1), disabled=True), sg.Text("Not checked", key='labelDeadlock', size=(30,1), justification='right', font=font), sg.Input('hmm', key="txtDeadlockQuery", visible=False)],
def input_info(lab, text_key, in_key, in_size=(45,1)): # falta meterle key al text return [sg.Text(lab, key=text_key), sg.Input(key=in_key, size=in_size)]