Flattening the Curve… with Code

Day 39 of 100 Days Coding Challenges: Python

Ah, 2020. The year when “going viral” took on a whole new (and not-so-fun) meaning. I remember first hearing about COVID-19 on the news—some distant reports from China that felt like a world away. A blink later, and boom: the whole globe was upside down, hand sanitizer became currency, and toilet paper was basically gold.

Fast forward to today, and here I am, playing with data from that very same pandemic—except now, instead of panic-buying canned beans, I’m pulling country-specific COVID data from the internet and turning it into lovely little graphs using matplotlib to create my own COVID data visualization program. Over the past few days, I’ve been on a visual journey with this powerful library, and let me tell you: nothing makes data feel more satisfying than watching it turn into a line chart especially when that line isn’t going straight up.

The data source of the day is disease.sh, a surprisingly friendly API for something that deals with viruses. My plan? Fetch real-time data, choose a country, and see what the case numbers look like. And who knows? Maybe one day, this skill will sneak its way into my work life when nobody’s looking.

Today’s Motivation / Challenge

Today’s project is about turning chaos into clarity—something all programmers secretly dream of. There’s something almost poetic about visualizing a pandemic: it’s the difference between abstract panic and concrete trends. This project connects data science to real life, while giving your Python skills some real-world relevance. Bonus points if you feel like a data sorcerer by the end.

Purpose of the Code (Object)

This little script fetches historical COVID-19 case data for any country you choose and plots a neat line graph of daily new cases. It’s like Google Trends, but you made it yourself—with actual code and zero ads. The result? A quick, clear visual of what’s going on behind the numbers.

AI Prompt:

“Create a simple Python program that fetches COVID-19 case data from disease.sh and visualizes daily new cases using matplotlib.”

Functions & Features

  • Fetches COVID-19 historical case data for the last 30 days
  • Converts cumulative case data into daily new case counts
  • Plots the results using a simple, clean line chart

Requirements / Setup

pip install requests matplotlib

Minimal Code Sample

response = requests.get(“https://disease.sh/v3/covid-19/historical/USA?lastdays=30”)

data = response.json()

cases = list(data[‘timeline’][‘cases’].values())

new_cases = [cases[i] – cases[i-1] for i in range(1, len(cases))]

plt.plot(new_cases)

plt.show()

This snippet fetches the last 30 days of COVID cases for the U.S. and plots daily new cases.

COVID Tracker

Notes / Lessons Learned

So, here’s the thing—I’ve been dancing with matplotlib for a couple of days now, and while I’m getting the hang of it, I still feel like it’s a slow waltz with occasional toe-stomping. The library itself is amazing if you’re pulling data off the internet, but setting up the project environment still feels like building IKEA furniture without the instructions.

I made the rookie mistake of renaming my project folder halfway through and then spent way too long trying to activate the wrong virtual environment. Hint: Python doesn’t respond to psychic guesses—you’ve gotta get the name right. Lesson learned. Anyhow, I managed to create a COVID data visualization in a Python program.

The structure of the plotting code feels eerily familiar now—almost like déjà vu with braces and colons. Maybe that’s a good sign: I’m starting to notice patterns, which means I’m leveling up.

Also, when I ran the U.S. data? There wasn’t much new info (thankfully), but the graph still did its thing like a loyal little data dog. Even in a post-peak-pandemic world, the code works, and that’s a small but nerdy joy.

Optional Ideas for Expansion

  • Add an input field to let users type any country name
  • Include a bar chart version for comparison
  • Export the graph as an image to share with friends who still think Python is a snake

Backwards Legs, a Stubborn Cable, and a Surprisingly Good 10K

Brian’s fitness journal after a brain stroke

This morning, after breakfast and settling in at my desk, I returned to what I believed was the final phase of assembling the stretching machine. I was confident. Dangerously confident.

A closer look at the schematic revealed the truth: I had installed the stabilizing legs backwards. Naturally. That meant undoing the last few steps, which turned into a couple of hours of careful disassembly, reassembly, and quiet self-criticism.

Problem solved—briefly.

Immediately after, I discovered a new issue. There’s a cable that runs from a lever to the legs, used to pull them apart. The cable was wound so tightly on its reel that it simply refused to reach the attachment point. I stared at it. It stared back. Neither of us budged.

At that point, I declared a tactical retreat and shifted focus to my weekly 10K run.

It was chilly, but my new warm running pants made it tolerable—and, thankfully, it was above glove temperature. I hit my target pace for the first 5K, which felt great. I couldn’t quite pull off the rare double success for the full distance, but I still logged my second-fastest 10K ever. I’ll take that win without argument.

Back home, I moved through the Saturday checklist: vacuuming, a shower, and then making soup for my wife and me—comfort food earned the honest way. After dishes, it was time for our weekly grocery run. Our water cooler was completely empty, so forgetting water was not an option. I’d already staged the empty bottles upstairs to make loading easier. Organization: achieved.

Transportation: complicated.

The city has closed the main intersection that exits our neighborhood—the one that leads directly to the grocery store. We discovered this last week, and the rumor is it’ll stay closed until April. So now every trip involves scenic backroads and low-grade grumbling. There’s not much to do except adapt and complain quietly.

This closure may also affect my annual physical appointment, which I normally walk to. I’ll need to scout the route on foot to see if it’s still passable—or accept the indignity of calling an Uber to drive me a mile.

Meanwhile, my brain kept circling back to the stretching machine. I searched online, fiddled with the reel and crank, and hunted for a release switch that would allow more cable to unwind. Nothing. The manual was unhelpful. The internet was silent.

So I’ve resolved to call customer service on Monday.

Do I have high hopes? No. Based on the manual, communication may not be their strongest skill. Still, it’s the only path forward. Maybe I’ll get lucky. Stranger things have happened.

The good news is that everything else is assembled correctly. Once the cable mystery is solved, the machine will be ready for use. Until then, it stands as a monument to perseverance.

By the end of the day, I was completely worn out—but in the good way. The kind where things didn’t go perfectly, but enough went right to make it count.

Monday will bring customer service.
Today brought effort.
And for now, that’s enough.

How to Track Stock Prices Using Python and yFinance

Day 38 of 100 Days Coding Challenge: Python

Investing has always been a guilty pleasure of mine—right up there with overpriced coffee and late-night book binges. Back when I barely had enough money to buy lunch, I was already trying to buy tiny slices of companies like I was collecting Pokémon cards. Fast forward to today, and every bank app practically throws stock charts at you like confetti. Still, I wanted something that was mine—a tiny, personal stock tracker. One that didn’t nag me about “low balances” or “risky decisions.” So, today’s project? A DIY stock price tracker built with Python. Just me, a graph, and the ever-fluctuating mood swings of the market.

Today’s Motivation / Challenge

There’s something oddly thrilling about watching a stock price graph crawl across your screen like a timid squirrel in traffic. Whether you’re new to investing or just want to see if your gut instinct about Tesla was right last week, tracking prices can be both educational and addictive. Plus, building your own tracker means you’re not relying on whatever clunky UI your bank thinks is “innovative.”

Purpose of the Code (Object)

This simple Python program fetches historical stock prices and plots them in a neat, interactive graph. You enter the stock symbol and date range, and it shows you the closing prices over time—no logins, no ads, no “upgrade to premium” pop-ups.

AI Prompt: 

 “Write a Python script that tracks a stock’s historical closing price over a specified date range and plots it using matplotlib.”

Functions & Features

  • Accepts a stock ticker symbol and a date range
  • Fetches stock data using Yahoo Finance
  • Plots closing prices in an interactive graph
  • Lets you zoom in, pan, and even save the chart as an image

Requirements / Setup

bash

CopyEdit

pip install yfinance matplotlib pandas

Minimal Code Sample

python

CopyEdit

import yfinance as yf

import matplotlib.pyplot as plt

data = yf.download(“AAPL”, start=”2024-01-01″, end=”2024-06-30″)

plt.plot(data.index, data[“Close”])

plt.title(“AAPL Closing Price”)

plt.show()

Fetches Apple’s closing prices and plots them—simple and sweet.

Stock Price Tracker

Notes / Lessons Learned


Today’s hiccup was classic: wrong environment, right idea. I had dutifully created a virtual environment and installed everything I needed—yfinance, matplotlib, and pandas. But when I launched Visual Studio Code, my eager fingers opened the wrong project folder. I ran the code. Boom. Error. No yfinance to be found. After a brief existential crisis and a quick switch to the correct environment, the code ran beautifully. A delightful little pop-up window showed me a clean graph of stock price movements. I could zoom in, pan around, even save it as a PNG. It felt like giving my inner stock nerd a new toy to play with. And yes—I fully plan to turn this into a functional tracker for my own portfolio. No offense to my bank’s app, but mine’s cooler.

Optional Ideas for Expansion

  • Add a moving average overlay to smooth out wild price swings
  • Include volume bars below the price graph for more context
  • Let the user compare two or more stocks on the same chart

Breaking News, Built by Me

Day 37 of 100 Days Coding Challenge: Python

I have so many morning routines now that I need a morning routine just to organize them. Somewhere between meditating, hydrating, and pretending I’ll stretch for ten minutes, I give myself about five sacred minutes to scroll headlines on Google Pixie—my beloved phone, not a whimsical AI assistant (though honestly, close). It’s funny to think how much easier it is now than in the ‘90s, when “catching up on the news” meant flipping through an actual newspaper or—if you were tech-savvy—tapping into Yahoo News. I used to wonder whether those top headlines were handpicked by real people or magically summoned by a robot in a cubicle. Well, today I decided to find out what it feels like to be that robot. Except mine runs on Python and coffee.

Today’s Motivation / Challenge

There’s something delightful about making your own mini news reader. It’s like building a personal butler who only tells you the important stuff—no ads, no clickbait, no Kardashian updates (unless you really want them). Today’s challenge wasn’t just about coding; it was about reclaiming five minutes of my day from mindless scrolling and putting a bit of personality into my news.

Purpose of the Code (Object)

This little script fetches the top headlines from the internet and displays them in your terminal—clean, fast, and focused. You don’t need to open a browser or wade through a swamp of autoplay videos. It’s just a straight shot to what’s happening in the world, courtesy of your own code.

AI Prompt:

Write a Python script that uses NewsAPI to display the top 10 headlines in the terminal. Use environment variables for the API key. Keep the script simple and readable.

Functions & Features

  • Connects to NewsAPI and fetches top news headlines
  • Displays each headline and a brief description (if available)
  • Includes clickable links for more information
  • Clean, readable terminal output

Requirements / Setup

  • Python 3.x

Install these packages:

pip install requests python-dotenv

Minimal Code Sample

from dotenv import load_dotenv

import os, requests

load_dotenv()

api_key = os.getenv(“NEWS_API_KEY”)

response = requests.get(“https://newsapi.org/v2/top-headlines”, params={

    “country”: “us”, “apiKey”: api_key, “pageSize”: 10

})

for article in response.json()[“articles”]:

    print(article[“title”])

This snippet grabs the top 10 headlines and prints their titles. Simple and effective.

News Headline Reader

Notes / Lessons Learned

The coding went suspiciously smoothly today—almost unsettling. I finally did what every tutorial whispers about but no one actually does: I created a dedicated virtual environment. Then I installed the required libraries like a responsible adult. Getting an API key from newsapi.org was straightforward, and I even tucked it safely into a .env file (no more hardcoded sins). .gitignore? Created. requirements.txt? Generated with pride. After a few past failures, I’m beginning to feel like I almost know what I’m doing. It’s like learning to ride a bike, except the bike is made of code and occasionally throws a syntax error.

Optional Ideas for Expansion

  • Add voice support using pyttsx3 to read headlines aloud (hello, audio butler)
  • Let the user filter headlines by category (e.g., sports, tech, science)
  • Include headlines from multiple countries using user input

Why Hydration Is Not a Task You Want to Cram

Brian’s fitness journal after a brain stroke

Yesterday was so busy that my hydration schedule quietly collapsed while I wasn’t looking.

After we returned from the running shoe store, I realized I was already about an hour behind on my water intake. I managed to catch up before heading out for my run, which felt like a small victory. Then I disappeared for two hours—and fell even further behind. This is not recommended behavior. At all.

My kidneys don’t function like those of a healthy adult, so hydration isn’t optional for me. My nephrologist is very clear: at least two liters of water a day, every day, to prevent my kidneys from filtering overly concentrated urine. To help with this, my wife and I both use water bottles marked with hour-by-hour drinking goals so we don’t quietly drift into dehydration.

Yesterday, however, life had other plans.

Vacuuming.
Showering.
Cooking supper.
Then our weekly grocery trip.

By the time I finally made it back to my desk, I was several hours behind schedule. I should have been done with my first liter and well into the second. Instead, I was staring down a very avoidable hydration deficit.

For a brief moment, I considered giving up on hitting the full two liters. But then I remembered that kidneys are not impressed by excuses. So I did what I had to do: I started guzzling water to catch up.

Our Hydration Routine, My for my Kidneys

We go through about five gallons of water per week in our house. We use a water dispenser because my wife is understandably cautious about water quality and my kidney health. The water is excellent—just not meant to be consumed in heroic quantities all at once.

I take hydration seriously, but I was worried that this late-day water surge would punish me overnight with constant bladder alarms. Still, I decided that was the price of falling behind earlier in the day.

Thankfully, timing worked out in my favor. I finished my water about thirty minutes before getting ready for bed, which gave my body just enough time to process most of it. I only had to get up once during the night—a win, all things considered.

So yes, I drank what I needed to drink.
And yes, I mostly avoided the consequences.

But this was not a strategy—it was damage control.

Today’s goal is simple: stay on schedule and don’t turn hydration into an evening endurance sport again.

I Built a Python Translator App I Needed in 1996

Day 36 of 100 days coding challenge: Python

I was born and raised in Japan, where nearly everyone speaks Japanese—surprise! But my household was a bit unusual. We had one of those rare satellite dishes that could pull in BBC and CNN, which meant English voices echoed through our living room long before they echoed through my brain. Add to that a small mountain of English children’s books, and you’d think I’d grow up effortlessly bilingual. Think again.

Later, I landed at an English-speaking university in Montreal, where people didn’t just speak English and French—they often casually tossed in a third or fourth language, like it was a party trick. Some of my classmates had parents who spoke Spanish at home, studied in French, and flirted in English. Meanwhile, I was sweating over conjugating irregular French verbs.

Despite my early exposure, mastering English (let alone French) was no walk in the linguistic park. Reading was one thing, but writing or speaking? That’s where the wheels came off. And back then—mid-90s Internet era—Google Translate didn’t exist. I had Netscape and patience. What I didn’t have was a little button that magically told me what “mettre en valeur” meant in context.

So today’s project? Python translator app. It’s my time-travel gift to my 1996 self: a translator app that could’ve saved me hours of flipping through dusty dictionaries.

Today’s Motivation / Challenge

Language learners know the pain: you read a sentence, understand each word, and still have no idea what it actually means. That’s the magic of context—and a good translator app can bridge the gap. Today, we build just that: a compact, no-nonsense translator you can summon from your command line like a 90s wizard with a keyboard instead of a wand. The goal isn’t to impress Google—it’s to outdo what the 90s Internet couldn’t give us.

Purpose of the Code (Object)

This simple translator app takes any sentence you feed it and converts it into your language of choice. It automatically detects the source language and spits out the translation, so you don’t even have to guess what language you’re struggling with. Think of it as your pocket linguist—minus the academic snobbery.

AI Prompt

That’s all it took. And with a few nudges, the app started behaving like the polite little translator it was always meant to be.

Functions & Features

  • Detects the input language automatically
  • Translates text to your chosen language
  • Supports dozens of language codes (like en, fr, ja, es)
  • Simple input-output interface via terminal

Requirements / Setup

pip install deep-translator

Tested on Python 3.13, but it works on any modern Python 3.x version.

Minimal Code Sample

from deep_translator import GoogleTranslator

translated = GoogleTranslator(source=’auto’, target=’fr’).translate(“I love books”)

print(translated)  # Prints: J’aime les livres

This line auto-detects the language and translates the sentence into French.

Python translator app

Notes / Lessons Learned

I started with an error today—like a true developer. I tried installing googletrans==4.0.0-rc1, which decided to throw a tantrum because it needed httpx 0.13.3, but my existing openai package was having none of it. The moment I hit run, Python practically screamed: “Pick a side!”

This was the moment I remembered virtual environments exist for a reason. If you’re juggling multiple packages like a circus clown with too many flaming clubs, isolate your apps before things catch fire. I’ll revisit virtual environments properly another day—but for now, I needed a workaround that worked.

Enter deep-translator. Easy install, no dependency drama, and—bonus—it respects your choice to lowercase your language codes. But be warned: this library is case-sensitive. Type FR instead of fr, and it gives you nothing but disappointment. You’ve been warned.

Optional Ideas for Expansion

  • Add a GUI interface with Tkinter or Streamlit to make it look more like a real app
  • Build a “translation history” feature to track past phrases
  • Integrate with a text-to-speech tool for pronunciation help

When Banks Get Boring, Build Your Own Converter

Day 35 of 100 Days Coding Challenge: Python

As an accountant, I sometimes find myself wrangling with currencies like the Euro or the Yen—especially when it’s time to pay international vendors. Sure, I could just hop over to a bank’s website to check the latest rate and be done with it. But where’s the fun in that? There’s something satisfying about making a mini tool that does the fetching for you. It’s like teaching your computer to do the boring part while you sip coffee and pretend you’re working very hard. Besides, who wouldn’t want their own personal exchange rate butler?

Today’s Motivation / Challenge

Today’s project was all about merging curiosity with practicality. Currency converters might not sound glamorous, but they’re surprisingly useful—and they offer the perfect excuse to explore how APIs work in the wild. Plus, if you’ve ever had to double-check if you’re about to overpay a vendor in yen, you’ll understand the thrill of watching your own Python script spit out the answer faster than your bank’s clunky interface ever could.

Purpose of the Code (Object)

This script fetches real-time exchange rates and converts any amount between two currencies. Instead of trusting your memory or the whims of Google, you can just run this quick script and let it do the math. It’s lightweight, no fuss, and runs right in your terminal.

AI Prompt:

Convert currency between any two valid codes using live data. Keep it light. No API keys, no hassle.

Functions & Features

  • Converts between any two standard currency codes (e.g., USD to JPY)
  • Fetches live exchange rates from a free public API
  • Displays the converted amount in real time
  • Includes error handling for invalid codes or bad input

Requirements / Setup

You’ll need:

pip install requests

Works with: Python 3.x

Minimal Code Sample

url = f”https://open.er-api.com/v6/latest/{from_currency.upper()}”

response = requests.get(url)

rate = response.json()[“rates”].get(to_currency.upper())

converted = amount * rate

This fetches the latest rates and calculates the converted amount.

Currency Converter

Notes / Lessons Learned

This program did not go down without a fight. There are two main ways to fetch real-time exchange rates:
Option 1 is using https://api.exchangerate.host/convert, which is free and doesn’t need an API key. It sounded perfect. I plugged in the URL, hit run, and got… nothing. After far too much debugging, I realized the problem wasn’t the code—it was that something on my system was redirecting that link to exchangeratesapi.io, a completely different API that demands an API key. DNS goblins? Old environment settings? Ghosts of APIs past? Who knows.

So, I switched to a new free option: https://open.er-api.com. No signup, no key, and it worked like a charm. The moral of the story? Sometimes the easiest-looking door is secretly locked, and the best path forward is just to find a different door. Preferably one that doesn’t ask for your email address.

Optional Ideas for Expansion

  • Add a list of common currency codes for reference
  • Let users select currencies from a simple dropdown in a GUI version
  • Track historical exchange rates for past transactions

Why You Shouldn’t Drink a Milkshake Before a 10K

Brian’s fitness journal after a brain stroke

Today’s plan was simple and efficient: visit the running shoe store to get my wife a fresh pair of shoes, then stop for a milkshake on the way home. We had a flier for a free milkshake, so naturally, we synchronized errands like responsible adults.

My wife takes running attire very seriously—and for good reason. She firmly believes that the wrong shoes invite injury, and improper clothing invites heat stroke, hypothermia, or, at the very least, regret. I don’t argue with this logic.

While we were there, I also replaced my aging cold-weather running pants. My old pair had reached the end of their honorable service, so I upgraded. Once we got home, I immediately put the new pants on and decided to break them in properly—with a full 10K run.

We don’t go out much on her days off because she usually has a long list of chores. But she’d already declared weeks ago that her running shoes were overdue for replacement. This outing had been scheduled in the household calendar long before the milkshake entered the story.

The milkshake, however, was my personal motivation.

My wife isn’t interested in milkshakes. She always takes one sip of mine, politely declares it “too sweet,” and hands it back. I, on the other hand, was thrilled. I hadn’t had a milkshake in years. Years.

And then I made a terrible decision.

I drank the entire milkshake right before heading out for my run.

Running with a belly full of milkshake is… not ideal. No matter how delicious it is, milkshake-fueled jogging is not a performance-enhancing strategy. This is a lesson I will absolutely remember: milkshakes belong after runs, not immediately before them.

The run itself was hard. I fought to keep my pace from collapsing more than 50 seconds below my target. I finished 49 seconds under instead—which is technically better, but emotionally still rough. By the end, my legs were fully aware that I had tried very hard.

They may become even more aware tonight.

I’m considering doing my weekly squats this evening instead of tomorrow. That would give me an extra recovery day before my Monday run, which should—at least in theory—help me be faster then.

So today’s takeaways:
  • New shoes: excellent
  • New pants: promising
  • Free milkshake: delicious
  • Timing of milkshake: catastrophic

Still, lessons were learned, gear was upgraded, and the run got done.
Next time, I’ll earn my milkshake the hard way—after the finish line.

BMI: Bridging the Gap Between Kilograms and Inches

Day 34 of 100 Days Coding Challenge: Python

I built my first Flask BMI calculator back on Day 7—just me, Python, and a simple formula. It worked well for metric units, crunchiDay 34 – BMI: Bridging the Gap Between Kilograms and Inchesng the numbers in centimeters and kilograms without complaint. But today, I decided to revisit it with a friendlier approach: one that welcomes both metric and imperial users. After all, some people think in kilos, others think in pounds—and both deserve an app that meets them where they are. So, I gave it a new home in Flask and added support for both systems. A small upgrade, but a meaningful one.

Today’s Motivation / Challenge

BMI calculators are a classic beginner’s project. They’re easy to understand, quick to build, and surprisingly useful. But for me, this wasn’t just about calculating numbers—it was about building a more thoughtful, inclusive tool. Rewriting it in Flask gave me a chance to sharpen my web development skills while creating something a little more flexible and user-friendly.

Purpose of the Code (Object)


This code creates a simple web app that calculates your Body Mass Index (BMI) based on your height and weight. You can choose between metric or imperial units, and the app will give you your BMI along with a general category, like “Normal” or “Overweight.” No fuss, just quick feedback.

AI Prompt:

“Create a Flask web app that calculates BMI from user input. Include support for both metric and imperial units, and display the result with a category like ‘Normal’ or ‘Overweight’.”

Functions & Features

  • Lets users select metric (kg/cm) or imperial (lb/ft+in)
  • Accepts user input for height and weight
  • Calculates BMI using the appropriate formula
  • Categorizes results (e.g., Underweight, Normal, Overweight, Obese)

Requirements / Setup

  • pip install flask

Minimal Code Sample

if unit == “imperial”:

    total_inches = float(ft) * 12 + float(inch)

    bmi = round((float(weight_lb) / (total_inches ** 2)) * 703, 2)

else:

    height_m = float(height_cm) / 100

    bmi = round(float(weight_kg) / (height_m ** 2), 2)

// Calculates BMI based on the selected unit system.

MBI Calculator Using Flask

*** I am very sorry, I realized I forgot to add to GitHub. I uploaded later. ***

Notes / Lessons Learned


When I first started working with Flask, things got messy fast. Each new app ended up in its own makeshift folder, and before long, I discovered that Flask can be downright fussy about file locations—especially when it comes to templates. That lesson pushed me to get organized. Now, every project gets its own environment, a dedicated folder, and a clearly named app file (I’ve officially retired the one-size-fits-all “app.py”). I also learned to run multiple apps on different ports, which made testing far less chaotic. A bit of structure early on, it turns out, saves a world of confusion later.

Optional Ideas for Expansion

  • Add JavaScript to display BMI results instantly without reloading
  • Store BMI history so users can track changes over time
  • Include wellness tips based on BMI results

Flask Forward: Building a Blog From Scratch (and Mild Panic)

Day 33 of 100 days coding challenge: Python

Personal Experience

I’ve been blogging for over six years, but not like this. My usual workflow involves logging into a WordPress site, clicking “New Post,” and typing away like a caffeinated raccoon. No programming. No servers. Definitely no manually structured file trees.

Then yesterday, I discovered Flask—a micro web framework in Python—and I couldn’t resist the “Hello, World” charm offensive. Today, I took it a step further: I built a miniature blog app. Not styled. Not database-backed. But it works. I can write a post, hit submit, and watch it appear like magic (or slightly awkward sorcery). It’s not pretty—yet—but it’s mine. And honestly, playing with this new toy has me feeling like the proud owner of a digital Easy-Bake Oven. You throw in some code, and out pops a web page. Delicious.

Today’s Motivation / Challenge

I’ve used blogs for years, but never thought of building one from the ground up. Today’s challenge wasn’t just about learning Flask—it was about flipping the curtain on the software I use every day. It’s like going from “driving a car” to “building one with duct tape and curiosity.” And you know what? Turns out the engine runs just fine.

Purpose of the Code (Object)

This mini app creates a simple blogging website. You can add a new post, view all existing ones, and pretend—for just a moment—that you’re running your own minimalist content empire. It doesn’t use a database yet—just keeps your posts in memory—but it’s a great stepping stone.

AI Prompt:

Write a simple Flask app that displays blog posts and lets users add a new one through a form. Keep it minimal, with in-memory storage and two HTML templates: one for the homepage and one for the post form.

Functions & Features

  • Displays a list of all blog posts
  • Lets users create a new blog post via a form
  • Stores posts temporarily (in memory)

Requirements / Setup

pip install flask

You’ll need Python 3.6 or later. Then just run app.py and open your browser.

Minimal Code Sample

@app.route(‘/new’, methods=[‘GET’, ‘POST’])

def new_post():

    if request.method == ‘POST’:

        title = request.form[‘title’]

        content = request.form[‘content’]

        blog_posts.append({‘title’: title, ‘content’: content})

        return redirect(url_for(‘home’))

    return render_template(‘new_post.html’)

This route displays a form or saves a post, depending on the request.

Mini Blog App

Notes / Lessons Learned

When working with Flask, file structure isn’t just a “nice to have”—it’s the entire vibe. The templates folder must be in the exact same level as app.py, or Flask will act like it doesn’t know you. I spent a good hour wondering why my beautiful new form page was blank. A quick “View Page Source” revealed… nothing. That’s when I realized: I hadn’t saved the file. Turns out I’d disabled auto-save in VS Code, and my new_post.html was basically a digital tumbleweed. Once I retyped it, saved everything properly, and restarted the app, the blog sprang to life—albeit looking like a Geocities relic. But I made it. And that’s what counts.

This experience reminded me: fancy tools are fun, but building something with your own code—flaws and all—is a different kind of thrill. I’m starting to see the potential here. Flask is no longer just “that framework with a cool name”—it might be the engine behind my next real web project.

Optional Ideas for Expansion

  • Add a timestamp to each post
  • Style it with Bootstrap for instant visual credibility
  • Save posts to a text file or SQLite database so they don’t disappear on refresh