Sep-10-2021, 08:52 AM
Hello there,
Apologies, a mock up, shortened version of my code is below and the error is further down.
However it is saying there are no arguments given, which confuses me as they're there! :')
Thanks,
James
Apologies, a mock up, shortened version of my code is below and the error is further down.
import PySimpleGUI as sg a = () def start(): layout1 = [[sg.Button("Next")]] window1 = sg.Window("Test",layout1,size=(300,300),finalize=True) event,values = window1.read() a = window1.CurrentLocation() print(a) print(type(a)) while True: if event == sg.WIN_CLOSED: break if event == "Next": window1.close() nextp() break def nextp(): global a layout2 = [[sg.T("")]] window2 = sg.Window("Test2",layout2,location=a,size=(300,300),finalize=True) event,values=window1.read() start()
Error:ValueError: not enough values to unpack (expected 2, got 0)
Now, as you can see I created an empty tuple to store the location (As it needs to be shared between functions, I've had to use a global one) and I've also printed the contents of 'a' which does display the x,y co-ordinates of the window, and changes depending on where the window is.However it is saying there are no arguments given, which confuses me as they're there! :')
Thanks,
James
while dad_has_cigs == True: happiness = True if dad_has_cigs == False: print("Dad come home!") happiness = not happiness break