Release 4.54.0
This commit is contained in:
parent
58a5b11913
commit
5c01c523da
9 changed files with 923 additions and 391 deletions
|
@ -868,30 +868,30 @@ Not only that, it's the Pythonic thing to do. Have a look at line 3 of the "Zen
|
|||
|
||||
> The Zen of Python, by Tim Peters
|
||||
>
|
||||
> Beautiful is better than ugly.
|
||||
> Explicit is better than implicit.
|
||||
> Simple is better than complex.
|
||||
> Complex is better than complicated.
|
||||
> Flat is better than nested.
|
||||
> Sparse is better than dense.
|
||||
> Readability counts.
|
||||
> Special cases aren't special enough to break the rules.
|
||||
> Although practicality beats purity.
|
||||
> Errors should never pass silently.
|
||||
> Unless explicitly silenced.
|
||||
> In the face of ambiguity, refuse the temptation to guess.
|
||||
> There should be one-- and preferably only one --obvious way to do it.
|
||||
> Although that way may not be obvious at first unless you're Dutch.
|
||||
> Now is better than never.
|
||||
> Although never is often better than *right* now.
|
||||
> If the implementation is hard to explain, it's a bad idea.
|
||||
> If the implementation is easy to explain, it may be a good idea.
|
||||
> Namespaces are one honking great idea -- let's do more of those!
|
||||
> Beautiful is better than ugly .
|
||||
> Explicit is better than implicit .
|
||||
> Simple is better than complex.
|
||||
> Complex is better than complicated.
|
||||
> Flat is better than nested.
|
||||
> Sparse is better than dense.
|
||||
> Readability counts.
|
||||
> Special cases aren't special enough to break the rules.
|
||||
> Although practicality beats purity.
|
||||
> Errors should never pass silently.
|
||||
> Unless explicitly silenced.
|
||||
> In the face of ambiguity, refuse the temptation to guess.
|
||||
> There should be one-- and preferably only one --obvious way to do it.
|
||||
> Although that way may not be obvious at first unless you're Dutch.
|
||||
> Now is better than never.
|
||||
> Although never is often better than *right* now.
|
||||
> If the implementation is hard to explain, it's a bad idea.
|
||||
> If the implementation is easy to explain, it may be a good idea.
|
||||
> Namespaces are one honking great idea -- let's do more of those!
|
||||
|
||||
|
||||
I just hope reading all these pages of documentation is going to make you believe that we're breaking suggestion:
|
||||
> If the implementation is hard to explain, it's a bad idea.
|
||||
> If the implementation is easy to explain, it may be a good idea.
|
||||
> If the implementation is hard to explain, it's a bad idea.
|
||||
> If the implementation is easy to explain, it may be a good idea.
|
||||
|
||||
I don't think PySimpleGUI is ***difficult*** to explain, but I am striving to fully explain it so that you don't do this:
|
||||
|
||||
|
@ -1067,7 +1067,7 @@ Caution is needed, however, when working with the unfinished ports. PySimpleGUI
|
|||
|
||||
While simple to use, PySimpleGUI has significant depth to be explored by more advanced programmers. The feature set goes way beyond the requirements of a beginner programmer, and into the required features needed for complex multi-windowed GUIs.
|
||||
|
||||
For those of you that have heard PySimpleGUI is only good for doing the most simplest of GUIs, this feature list should put that myth to rest. **The SIMPLE part of PySimpleGUI is how much effort _you_ expend to write a GUI, not the complexity of the program you are able to create.** It's literally "simple" to do... and it is not limited to simple problems.
|
||||
**The SIMPLE part of PySimpleGUI is how much effort _you_ expend to write a GUI, not the complexity of the program you are able to create.** It's literally "simple" to do... and it is not limited to simple problems.
|
||||
|
||||
Features of PySimpleGUI include:
|
||||
|
||||
|
@ -1139,6 +1139,8 @@ Features of PySimpleGUI include:
|
|||
- No async programming required (no callbacks to worry about)
|
||||
- Built-in debugger and REPL
|
||||
- User expandable by accessing underlying GUI Framework widgets directly
|
||||
- Exec APIs - wrapper for subprocessing and threading
|
||||
- UserSettings APIs - wrapper for JSON and INI files
|
||||
|
||||
---
|
||||
|
||||
|
@ -1286,58 +1288,46 @@ Like above, you may have to install either pip or tkinter. To do this on Python
|
|||
|
||||
## Upgrading from GitHub Using PySimpleGUI
|
||||
|
||||
Starting in version 4.17.0 there is code in the PySimpleGUI package that upgrades your previously pip installed package using the latest version checked into GitHub.
|
||||
There is code in the PySimpleGUI package that upgrades your previously pip installed package to the latest version checked into GitHub.
|
||||
|
||||
Previously if you wanted to run the GitHub version, you would:
|
||||
* Download the PySimpleGUI.py file from GitHub
|
||||
* Place it in your applications's folder
|
||||
It overwrites your PySimpleGUI.py file that you installed using `pip` with the currently posted version on GitHub. Using this method when you're ready to install the next version from PyPI or you want to maybe roll back to a PyPI release, you only need to run `pip`.
|
||||
|
||||
This required you to go back later and delete this file when you want to move on to the next version released to PyPI.
|
||||
### The PySimpleGUI "Test Harness"
|
||||
|
||||
The new capability is the ability to overwrite your PySimpleGUI.py file that you installed using `pip` with the currently posted version on GitHub. Using this method when you're ready to install the next version from PyPI or you want to maybe roll back to a PyPI release, you only need to run `pip`. You don't have to find and delete any PySimpleGUI.py files.
|
||||
If you call `sg.main()` then you'll get the test harness and can use the upgrade feature.
|
||||
|
||||
***Important - Linux Users*** - There is currently a problem using this utility on Linux systems. It's being worked on and a patch will be released as soon as something is figured out.
|
||||
After you've pip installed, you can use the commands `psgmain` to run the test harness or `psgupgrade` to invoke the GitHub upgrade code.
|
||||
|
||||
There have been problems on some machines when `psgmain` and `psgupgrade` are used to upgrade PySimpleGUI. The upgrade is in-place so there can be file locking problems. If you have trouble using these commands, then you can also upgrade using this command:
|
||||
|
||||
`python -m PySimpleGUI.PySimpleGUI upgrade`
|
||||
|
||||
The "Safest" approach is to call `sg.main()` from your code and then click the red upgrade button.
|
||||
|
||||
|
||||
#### Command Line Upgrade
|
||||
|
||||
To upgrade PySimpleGUI from the command line type this command into your dos window
|
||||
|
||||
`python -m PySimpleGUI upgrade`
|
||||
|
||||
You will first be shown a confirmation window:
|
||||
|
||||

|
||||
|
||||
If you choose yes, then the new version will be installed and you'll see a red "completed" window
|
||||

|
||||
|
||||
|
||||

|
||||
### Recovering From a Bad GitHub Release
|
||||
|
||||
If you run into a problem upgrading after upgrading from GitHub, you can likely use pip to uninstall, then re-install from PyPI to see if you can upgrade again from GitHub.
|
||||
|
||||
|
||||
#### GUI Upgrade
|
||||
|
||||
The PySimpleGUI Test Harness is another mechanism you can use to upgrade. To start the test harness you "run" the PySimpleGUI package.
|
||||
|
||||
`python -m PySimpleGUI.PySimpleGUI`
|
||||
|
||||
Of course if you're running Linux you may run `python3` instead.
|
||||
|
||||
From your code you can call `PySimpleGUI.main()`. This window may not look exactly like the one you see, but the thing that should be there is the red "Install" button.
|
||||
|
||||

|
||||
`pip uninstall PySimpleGUI`
|
||||
`pip install PySimpleGUI`
|
||||
|
||||
|
||||
Clicking the install button will bring up the same confirmation window shown as the command line upgrade above.
|
||||
|
||||
### 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. At the command prompt start up Python.
|
||||
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 Test Harness 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.
|
||||
|
||||
`psgmain` is a command you can enter to the run PySimpleGUI test harness if you pip installed. You can also use:
|
||||
|
||||
From your command line type:
|
||||
`python -m PySimpleGUI.PySimpleGUI`
|
||||
|
||||
|
@ -1393,7 +1383,7 @@ Just like when using the REPL >>> to determine the location, this `print` in you
|
|||
|
||||
### Manual installation
|
||||
|
||||
If you're not connected to the net on your target machine, or pip isn't working, or you want to run the latest code from GitHub, then all you have to do is place the single PySimpleGUI source file `PySimpleGUI.py` (for tkinter port) and place it in your application's folder (the folder where the py file is that imports PySimpleGUI). Your application will load that local copy of PySimpleGUI as if it were a package.
|
||||
If you're not connected to the net on your target machine, or pip isn't working, or you want to run the latest code from GitHub, then all you have to do is place the single PySimpleGUI source file `PySimpleGUI.py` (for tkinter port) in your application's folder (the folder where the py file is that imports PySimpleGUI). Your application will load that local copy of PySimpleGUI as if it were a package.
|
||||
|
||||
Be ***sure*** that you delete this PySimpleGUI.py file if you install a newer pip version. Often the sequence of events is that a bug you've reported was fixed and checked into GitHub. You download the PySimpleGUI.py file (or the appropriately named one for your port) and put with your app. Then later your fix is posted with a new release on PyPI. You'll want to delete the GitHub one before you install from pip.
|
||||
|
||||
|
@ -1406,16 +1396,18 @@ PySimpleGUI Runs on all Python3 platforms that have tkinter running on them. It
|
|||
|
||||
### EXE file creation
|
||||
|
||||
If you wish to create an EXE from your PySimpleGUI application, you will need to install `PyInstaller`. There are instructions on how to create an EXE at the bottom of this document.
|
||||
|
||||
If you wish to create an EXE from your PySimpleGUI application, you will need to install `PyInstaller` or `cx_freeze`. There are instructions on how to create an EXE at the bottom of this document.
|
||||
|
||||
The PySimpleGUI EXE Maker can be found in a repo in the PySimpleGUI GitHub account. It's a simple front-end to pyinstaller.
|
||||
|
||||
## IDEs
|
||||
|
||||
A lot of people ask about IDEs, and many outright fear PyCharm. Listen up.... compared to your journey of learning Python, learning to use PyCharm as your IDE is NOTHING. It's a DAY typically (from 1 to 8 hours). Or, if you're really really new, perhaps as much as a week *to get used to*. So, we're not talking about you needing to learn to flap your arms and fly.
|
||||
A lot of people ask about IDEs, and many outright fear PyCharm. Compared to your journey of learning Python, learning to use PyCharm as your IDE is **nothing**. It's a DAY typically (from 1 to 8 hours). Or, if you're really really new, perhaps as much as a week *to get used to*. So, we're not talking about you needing to learn to flap your arms and fly.
|
||||
|
||||
To sum up that paragraph, stop whining like a little b*tch. You're a grown man/woman, act like it. "But it's hard..." If you found this package, then you're a bright person :-) Have some confidence in yourself for Christ sake.... I do. Not going to lead you off some cliff, promise!
|
||||
If you found this package, then you're a bright person :-) Have some confidence in yourself for Christ sake.... I do. Not going to lead you off some cliff, promise!
|
||||
|
||||
Some IDEs provide virtual environments, but it's optional. PyCharm is one example. For these, you will either use their GUI interface to add packages or use their built-in terminal to do pip installs. **It's not recommended for beginners to be working with Virtual Environments.** They can be quite confusing. However, if you are a seasoned professional developer and know what you're doing, there is nothing about PySimpleGUI that will prevent you from working this way. It's mostly a caution for beginners because more often than not, they get really messed up and confused.
|
||||
Some IDEs provide virtual environments, but it's optional. PyCharm is one example. For these, you will either use their GUI interface to add packages or use their built-in terminal to do pip installs. **It's not recommended for beginners to be working with Virtual Environments.** They can be quite confusing. However, if you are a seasoned professional developer and know what you're doing, there is nothing about PySimpleGUI that will prevent you from working this way.
|
||||
|
||||
### Officially Supported IDEs
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue