'TypeError: object of type 'NoneType' has no len() | PySimpleGUI | MacOS

I am coding a PySimple GUI script and I keep getting this:

TypeError: object of type 'NoneType' has no len()

(clipping of code)

window = sg.Window('Pico Ducky Script Manager', layout, size=(950, 350)) #950, 170

while True:
  event, values = window.read()

full code here: https://github.com/p-i-c-o/Pico-Ducky-Script-Manager/blob/main/new.py

I did some research and it seems the Window var. is empty so it gives me the error, but I've got no clue on how to fix it

When it runs, it starts in my app bar, then it dissapears.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source