This is my code:
import PySimpleGUI as sg
import datetime
from datetime import date
import pandas as pd
columns = ["TYPE","DIRECTION","DATE","OPTION"]
param = (20,3) # size of the main window
def GUI():
sg.theme('Dark Brown 1')
listing = [sg.Text(u, size = param) for u in columns]
core = [
sg.Input(size = param),
sg.Input(size = param),
sg.Input(size = param),
sg.Input(size = param)]
mesh = [[x,y] for (x,y) in list(zip(listing, core))]
layout =[[sg.Button("SEND")]]+ mesh
window = sg.Window('Trade Entry System', layout, font='Courier 12').Finalize()
while True:
event, values = window.read()
if event == "SEND":
data = values
a = list(data.values())
df = pd.DataFrame(a, index = columns)
df = df.transpose()
print(df)
else:
print("OVER")
break
window.close()
GUI()
What i want to do is for example if the string 'STOCK' is inputted into the TYPE input then the remaining 3 input boxes should be filled with predefined values. For example DIRECTION filled with 'B', Date with 'TODAY' and OPTION with 'PUT'.
I am unsure how to start so any help would be great