Nov-08-2021, 12:11 PM
Good morning,
Please excuse my ignorance I have tried searching the forums to no avail.
I'm trying to generate multiple windows using pysimplegui based on a mysql select statement
There are two rows, what im struggling with is the window generation, im not sure how to implement a new window re using a window layout.
This is my test code
What is the correct way?
I would like a new window generated based on the row count.
Thanks for your time.
Please excuse my ignorance I have tried searching the forums to no avail.
I'm trying to generate multiple windows using pysimplegui based on a mysql select statement
There are two rows, what im struggling with is the window generation, im not sure how to implement a new window re using a window layout.
This is my test code
def resultslayout(): mycursor = mydb.cursor() mycursor.execute("SELECT * FROM testtable") myresult = mycursor.fetchall() count = mycursor.rowcount for row in myresult: layout2 = [[sg.Text(row[1]+" Rowcount = " + str(count))], [sg.OK()], ] window = sg.Window('Second Form', layout2) event, values = window.read() window.close()This generates two windows, but the same mysql result, I'm guessing i need to move the window layout out of the for loop and replace it with the window generation BUT this causes an error in regards to reusing old window layouts.
What is the correct way?
I would like a new window generated based on the row count.
Thanks for your time.