how to python package code example

Example 1: python pip install

## To install Pip, first download get-pip.py from:
https://bootstrap.pypa.io/get-pip.py
  
## Then run the following command in the command line
## in the folder where the file has been saved.
python get-pip.py

Example 2: how to make python package

# This is too much for a grepper answer, so here is a link to the tutorial:
# https://towardsdatascience.com/how-to-build-your-first-python-package-6a00b02635c9

Example 3: pypi release

python3 setup.py sdist bdist_wheel
twine upload dist/*

Example 4: python upload to pip

1. Create files:
    __init__.py   setup.py   README.md   LICENSE
2. Check for setuptools and wheel:
    pip install --user --upgrade setuptools wheel
3. Generate package:
    py setup.py sdist bdist_wheel
4. Upload to pip:
    twine upload dist/*

Example 5: python interpreter pip

# context=ssl._create_unverified_context()
conn = http.client.HTTPSConnection("api/hostname.ca", context=ssl._create_unverified_context())
httplib.HTTPSConnection(hostname, timeout=5, context=ssl._create_unverified_context())

Tags:

Misc Example