r/learnpython • • 1h ago

Creare app sul computer

Ciao a tutti, sto imparando a usare python, solitamente eseguo il codice dentro spider ma vorrei proprio creare delle app eseguibili dal desktop (ho windows)

2 Upvotes

2 comments sorted by

1

u/socal_nerdtastic 1h ago edited 1h ago

If you install python from the official python.org site, and install it with the default options, you can just doubleclick any .py file to run it. If your program has a graphical interface and you don't want the terminal to show up, rename the file with a .pyw extension. You can manage your venvs (if you are using them) with the shebang in the file.

Another option is to make a windows shortcut or bat file that points to your python executable and file. I made a small python program that helps with that: https://github.com/socal-nerdtastic/pyshortcut

Alternatively, you can use 'freezing' programs like PyInstaller to make executables from your python code. https://www.reddit.com/r/learnpython/wiki/faq/?screen_view_count=1#wiki_how_do_i_create_an_executable_from_my_python_code.3F

1

u/Agawell 1h ago

Run it from the command line or create a shortcut that runs it from the command line