Ethan
Ethan

Reputation: 321

How to change a python script into an app

I wrote a python cli app which works fine. But every time I want to use it I should use python3 myapp.py which is not the nice and useful way especially because I want to make this app ready to use in pypy so that users might install it using pip.

I want to know the process of changing a python script into a real cli app.

Upvotes: 2

Views: 4504

Answers (1)

Freddy Garcia Cala
Freddy Garcia Cala

Reputation: 414

If you want to make it available to users via pip, you should create the package, build it and upload it to the Python Package Index. There is a tutorial on how to do this in the official docs: Packaging Python Projects

It will show you how to add the necessary files and structure to create the package, how to build the package, and how to upload it to the Python Package Index.

If you want to convert your python script into an excutable you can use Pyinstaller. It works on Windows, Linux, and Mac:

Install PyInstaller from PyPI:

pip install pyinstaller 

Go to your program’s directory and run:

pyinstaller yourprogram.py 

This will generate the bundle in a subdirectory called dist.

Upvotes: 3

Related Questions