Search code examples
pythonuser-interfacecross-platformpysimplegui

PySimpleGUI icons cross-platform support


I was wondering if there was a way to make a PySimpleGUI application have an icon (the icon you use to switch apps at the bottom of the screen) that works on Windows and MacOS. I know that Windows needs ico and MacOS need icns, so, is there a way to include both and have it switch to the right one depending on the OS?


Solution

  • An example of a platform-dependent assignment:

    import platform
    
    icon = icon1 if platform.system() == 'Windows' else icon2
    

    BTW we use the same .ico file for both Windows and MacOS.