Python

  • languages
  • in current work

Python was my first language. The one that made me realize I could actually do this, that programming wasn't some walled garden for people with computer science degrees. Its syntax read almost like English, and within weeks I was automating things that used to take me hours by hand. That early momentum shaped everything that came after.

It's still the language I reach for when I need to get something working fast. The Wine Sommelier backend, the Companies Summary Generator, Funding News Automation, the PDF Data Extractor. All Python. Web scraping, API development with Flask, data analysis, quick scripts to glue things together. It does everything, and it does it without making you fight the language to get there. I got so used to TypeScript's type system that I now write Python with type hints everywhere. Old habits die hard, and honestly the code is better for it.

hanzi-path-app/tools/build.pylines 1038–1061 on GitHub
def teachable(c):
    if c not in gfx or c not in dic:
        return False
    if c in common:
        return True
    # a part: more than a stroke, and something it means
    return len(gfx[c]["strokes"]) >= 2 and bool(garden.get(c) or dic[c].get("definition"))

order, seen = [], set()

def visit(c, depth=0, whole=False):
    if c in seen or depth > 6:
        return
    seen.add(c)
    for p in ([] if whole else components(dic[c])):
        if p != c and teachable(p):
            visit(p, depth + 1)
    order.append(c)

for c in STARTERS:
    common.add(c)
    visit(c, whole=True)   # a picture: taught whole, its strokes aren't parts yet
for c in top:
    visit(c)