Aug-27-2024, 04:38 PM
I need a pop-up message that will take a text input. I need a button to submit the input and one to abort the entire program. I have one solution, but I would rather have one that I am not paying $99 per year for a pop-up. Here is what I have. Could you guys show me another way to do the pop-up?
[/url][/img]
for x in range (numberOfFiles): row_data = read_data.iloc[x] ts = row_data.iloc[0] if ts == target_ts: target_row = x break if x == (numberOfFiles - 1): bad_ts = True while bad_ts: # setup message box layout = [[sg.Text('Invalid TS- number')], [sg.Text('Enter valid number'), sg.InputText()], [sg.Button('Submit'), sg.Button('Abort Test')]] # Create the Window window = sg.Window('Window Title', layout) # Event Loop to process "events" and get the "values" of the inputs while True: event, values = window.read() if event == sg.WIN_CLOSED or event == 'Abort Test': # if user closes window or clicks cancel if event == 'Abort Test': exit() break target_ts = values[0] window.close()[/color] for x in range(numberOfFiles): row_data = read_data.iloc[x] ts = row_data.iloc[0] if ts == target_ts: target_row = x bad_ts = False break
![[Image: pop-up.jpg]](https://i.postimg.cc/kRSxFPbR/pop-up.jpg)