What I've learnt about Python

What I've learnt about Python

If you have Python Installed already.

You can do very cool things with it.

Why I love Streamlit for Quick UI’s 📌

Streamlit uses a combination of front-end technologies to create its user interface, primarily leveraging React.js, a popular JavaScript library for building user interfaces.

  • React.js: Used for building dynamic and responsive user interfaces.
  • WebSockets: Maintains a real-time connection between the client and server for instant updates.
  • Tornado: A Python framework that handles long-lived connections and supports the server’s real-time operations.
  • Custom Components: Allows integration of additional web technologies like JavaScript, enhancing functionality.
  • Bootstrap: Provides styling and theming capabilities to customize the appearance of applications (CSS Framework).
  • Widgets and Markdown: Supports a variety of interactive widgets and Markdown for easy UI development.

This setup enables you to quickly create interactive web apps using Python, without needing extensive frontend development skills.

Python Apps Reliability

A good readme does the trick for any project.

This is a good Python Project Readme.

Python Virtual Envs

There are several ways to install Python Dependencies.

Python must have pip & venv ready 📌
sudo apt install python3-pip
sudo apt install python3.10-venv
Make the dependencies Work: Venv’s in Python 📌
python -m venv solvingerror_venv #create the venv

solvingerror_venv\Scripts\activate #activate venv (windows)
source solvingerror_venv/bin/activate #(linux)

Install them with:

pip install beautifulsoup4 openpyxl pandas numpy==2.0.0
pip install -r requirements.txt #all at once
#pip freeze | grep langchain

pip show beautifulsoup4
pip list
#pip freeze > requirements.txt #generate a txt with the ones you have!
source .env

#export OPENAI_API_KEY="your-api-key-here"
#set OPENAI_API_KEY=your-api-key-here
#$env:OPENAI_API_KEY="your-api-key-here"
echo $OPENAI_API_KEY

Containers for Python Apps

Making sure a Python app will always work is by building & using containers.

Local container build 📌
#docker build -t trip_planner .
DOCKER_BUILDKIT=1 docker build --no-cache --progress=plain -t trip_planner .
CI/CD container build 📌
You can use tools like: Jenkins, or Github Actions CI/CD Workflows