Python 3 Pure Starter Template with Pipenv (Project Dependencies Manager)
1. Setting up Python before launching the project:
Install "Python Version Manager" (pyenv):
curl https://pyenv.run | bash
# add this commands:
export PYENV_ROOT=" $HOME /.pyenv"
command -v pyenv > /dev/null || export PATH=" $PYENV_ROOT /bin:$PATH "
eval " $( pyenv init -) "
# here:
nano ~ /.bash_profile
# and here:
nano ~ /.bashrc
# then add this commands:
eval " $( pyenv virtualenv-init -) "
Restart terminal and install Python LTS:
pyenv install 3.12.0
pyenv global 3.12.0
Upgrade PIP manager to latest version [maybe with sudo]:
pip install --upgrade pip
2. Install the package manager and run the project:
Install Project Dependencies Manager (pipenv) [maybe with sudo]:
pip install --user pipenv
Run the project using Pipfile script "dev":
To install new packages with pipenv:
pipenv install [package_name]
To install all packages from Pipfile:
If you want to share your code with someone, but make it unreadable:
python3 -OO -m py_compile [your_file_name].py
python3 __pycache__/[your_file_name].pyc