I'm unable to use PySimpleGUI.Table because of my inability to create list of lists, please see my code:
def is_compiled(file):
full_path = main_path + 'models_data/'+ file[:-3]
return isdir(full_path) #Returns bool True of False
models_src = [f for f in listdir(model_src_path) if isfile(join(model_src_path, f))]
is_compiled_list = [str(is_compiled(f)) for f in models_src]
table_list = [models_src,is_compiled_list]
print(table_list)
printing my lists shows:
[['CNN_v1.py', 'test.py'], ['False', 'True']]
and type is <class 'list'>
But when I try to put this list into sg.Table:
table_headings = ['name','iscompiled?']
layout = [[sg.Table(table_list,headings=table_headings]]
window = sg.Window("Demo", layout, margins=(500, 300))
while True:
event, values = window.read()
I'm getting this error message:
list indices must be integers or slices, not Text
I know this is probably a very simple solution but I was trying to find it for hours and I couldn't. Thanks for help!
EDIT:Typo