(answered] I’m learning SimpleGui and when adding multiple widgets to the layout the system gives me a TypeError. Here is my code for the layout
JavaScript
x
6
1
layout = [
2
[sg.Text("I have no idea what i am doing")]
3
4
[sg.Text("i wanna make games and stuff")]
5
]
6
I’m using version 3.10.0 of python if that helps
Advertisement
Answer
You’re missing a comma between your two lists:
JavaScript
1
5
1
layout = [
2
[sg.Text("I have no idea what i am doing")],
3
[sg.Text("i wanna make games and stuff")]
4
]
5
The error you get (TypeError: list indices must be integers or slices, not Text
) is because the python interpreter thinks you’re trying to index into the first list with your second list.