With the help of pyinstaller, if it is not installed, manually pip
pip install pyinstaller
Open the command line and switch to the packaged test.py path
enter
pyinstaller -F -w test.py
After the execution is completed, there is a dist folder in the directory of the test.py file, which contains the exe file.