pyinstaller myscript.py -F
The options to generate a single file are -F or --onefile. This bundles the program into a single myscript.exe file.
Single file executable are slower than the one-folder bundle. They are also harder to debug.
Get monthly updates about new articles, cheatsheets, and tricks.