Thursday, 22 January 2026

Create a True Windows App (.exe) Using PyInstaller

 

Create a True Windows App (.exe) Using PyInstaller

This produces:

  • A single .exe file

  • Double‑click → launches your Streamlit app

  • No need for users to install Python

  • Works offline

✅ Step 1 — Create a launcher script

Create a file named run_app.py:

python
import subprocess
import sys
import os

# Path to your Streamlit app
APP_FILE = "app.py"

# Launch Streamlit
subprocess.run([sys.executable, "-m", "streamlit", "run", APP_FILE])

✅ Step 2 — Install PyInstaller

Code
pip install pyinstaller

✅ Step 3 — Build the .exe

Run this in the folder containing run_app.py:

Code
pyinstaller --noconfirm --onefile --windowed run_app.py

What you get:

Code
dist/
   run_app.exe

Double‑click → your rainfall generator opens automatically in the browser.

how to start with Streamlit?

Starting with Streamlit is genuinely one of the easiest and most enjoyable ways to build an interface for your scientific tools. You don’t need to know HTML, CSS, or JavaScript — everything is pure Python, and it feels natural for someone with your workflow.

Let me walk you through it step by step so you can get your first Streamlit app running today.

🌟 1. Install Streamlit

Open your terminal or Anaconda prompt and run:

Code
pip install streamlit

That’s it — Streamlit is now ready.

🌟 2. Create Your First App

Create a new file called:

Code
app.py

Put this inside:

python
import streamlit as st

st.title("Hello, Streamlit!")
st.write("This is your first Streamlit app.")

🌟 3. Run the App

In your terminal, navigate to the folder containing app.py and run:

Code
streamlit run app.py

Your browser will open automatically with your app running at:

Code
http://localhost:8501

You now have a working Streamlit interface.

🌟 4. Understand the Basic Building Blocks

Streamlit gives you simple, intuitive components:

Text

python
st.title("My App")
st.header("Section")
st.write("Normal text")

Inputs

python
name = st.text_input("Enter your name")
number = st.number_input("Choose a number", min_value=1, max_value=100)

Buttons

python
if st.button("Run"):
    st.write("Button clicked!")

File Upload

python
uploaded = st.file_uploader("Upload CSV", type=["csv"])

Download Button

python
st.download_button("Download", data="hello", file_name="test.txt")

Progress Bar

python
import time
progress = st.progress(0)
for i in range(100):
    time.sleep(0.01)
    progress.progress(i+1)

Tuesday, 20 January 2026

How to Download CMIP6 Precipitation Data (NESM3 | SSP5-8.5)


In this tutorial explains the specific steps required to obtain Global Climate Model (GCM) data from the CMIP6 archive. The video focuses on the NESM3 model from China, specifically looking at the SSP5-8.5 scenario for long-term precipitation climate projections. However, the steps can be used to downscale different climate models and climate scenarios that been listed on the CMIP6 archive (https://cds.climate.copernicus.eu/).

 


Thursday, 25 December 2025

Stream & Catchment Delineation Using QGIS (r.watershed)


In this tutorial, we explore how to delineate a catchment using QGIS, focusing on the powerful r.watershed algorithm from the GRASS GIS toolbox. This tool allows users to generate flow direction, flow accumulation, and watershed boundaries directly from a Digital Elevation Model (DEM). Whether you're a student learning hydrological analysis for the first time or a practitioner refining your workflow, this guide provides a clear, step‑by‑step approach to producing reliable catchment boundaries using open‑source software.