Testing The Installation of PySimpleGUI
The PySimpleGUI "Home Window"
The command line command psghome
will open the PySimpleGUI Home Window. This is an important window for you to access as it's where you manage your License Key, upgrade to development builds, and modify the system-settings.
You can also open the Home Window by calling sg.home()
from your code.
Testing your installation and Troubleshooting
Once you have installed, or copied the .py file to your app folder, you can test the installation using python.
The Quick Test
The PySimpleGUI Home Window pictured in the previous section on GUI upgrades is the short program that's built into PySimpleGUI that serves multiple purposes. It exercises many/most of the available Elements, displays version and location data and works as a quick self-test.
psghome
or psgmain
are the same command and you can enter either to the run PySimpleGUI Home Window if you pip installed. You can also use:
From your command line type:
python -m PySimpleGUI
If you're on Linux/Mac and need to run using the command python3
then of course type that.
This will display the Home Window window.
You can also test by using the REPL....
Instructions for Testing Python 3:
You will see a "Home Window" that exercises the SDK, tells you the version number, allows you to try a number of features as well as access the built-in development build upgrade utility.
Finding Out Where Your PySimpleGUI Is Coming From
It's critical for you to be certain where your code is coming from and which version you're running.
Sometimes when debugging, questions arise as to exactly which PySimpleGUI you are running. The quick way to find this out is to again, run Python from the command line. This time you'll type:
When you type sg, Python will tell you the full patch to your PySimpleGUI file / package. This is critical information to know when debugging because it's really easy to forget you've got an old copy of PySimpleGUI laying around somewhere.
Finding Out Where Your PySimpleGUI Is Coming From (from within your code)
If you continue to have troubles with getting the right version of PySimpleGUI loaded, THE definitive way to determine where your program is getting PySimpleGUI from is to add a print to your program. It's that simple! You can also get the version you are running by printing.
Just like when using the REPL >>> to determine the location, this print
in your code will display the same path information.
Verifying Authenticity
Beginning with PySimpleGUI 5, all releases can be verified as being authentic and unaltered. When PySimpleGUI is imported it runs a self-test to see if there have been any modifications done to the software. If the code is found to be altered, you are shown a warning message and asked if you wish to continue executing your code.
Because PySimpleGUI is distributed as source code, it is possible for someone to alter the code in a way that goes unreported. To be sure your copy of PySimpleGUI has not been altered you can upload the code to our website and run a test to see if you have an authentic, and unaltered release.
For more information, check out the Security section.