The Lazy Python Tutor:為不想看教學的人打造的 Python 導師
The Lazy Python Tutor: I built a tutor for people who don't want a tutorial
作者打造了 The Lazy Python Tutor,讓用戶提出 Python 問題後,先獲得淺白解釋,再看簡短可執行範例和可選練習提示。應用以 Streamlit 和 Python 開發,透過 OpenRouter 免費路由開放權重模型,總運行成本為 $0,並會記住對話以承接後續問題。
This is a submission for the Hacktoberfest 2026 DEV Challenge — Week 3: Slow and Steady.
What I built
The Lazy Python Tutor — ask any Python question, get a plain-English explanation first, then a short runnable example, then one tiny optional practice prompt. That's it. No 40-minute video. No 12 documentation tabs. No homework list.
Live app: https://lazy-py-tpvbo7rexyrv4af4lv64qb.streamlit.app/
Repo: https://github.com/ashleygirl3723/lazy-python-tutor
Try asking:
What is a variable?
How do loops work?
Why does my code say IndentationError? — paste your broken code and it names the most likely problem, shows the fixed version, and says what changed in one sentence.
It remembers the conversation, so follow-ups build on what you already asked.
Why I built this — honestly
I'm learning Python myself, in a 30-day self-paced course, mostly on my laptop between caregiving shifts. I know exactly where beginners quit: not because Python is hard, but because every small question turns into a huge tutorial.
"What does elif mean?" should not require watching half a course. I kept wishing I could just ask — in plain words, get a plain answer, see one tiny example, and move on with my day.
So for "Slow and Steady" — build something with open-weight AI that rewards laziness — I built the tutor I wanted. Laziness here isn't cutting corners. It's respecting your time and energy. Slow and steady is literally how I'm learning: one small question at a time.
The design enforces that in the system prompt, which is the whole brain of the app:
Plain English first — no jargon without immediately explaining it
Then a short example — usually under 10 lines, nothing extra
Then one tiny practice prompt — labeled "Feeling ambitious? Try this:" — genuinely tiny, always optional
Hard rules in that prompt: keep it under ~200 words plus code, never dump code without explaining it first, and if code is broken, name the one most likely problem — not a lecture.
That last part matters to me personally. My most common mistakes are picky syntax things — capitalized If/Print (phone autocorrect loves that one), missing colons, missing indents, dropping the variable after elif. A good lazy tutor spots the one thing, fixes it kindly, and doesn't make you feel dumb for it.
How it's built
Streamlit chat interface, Python, deployed free on Streamlit Cloud — runs in any browser, phone included
Open-weight models via OpenRouter's free tier — openrouter/free auto-router picks a working free open-weight model per call. No credit card, no paid API.
One system prompt does the teaching — the tutor's personality, answer shape, and honesty rules all live in one readable block at the top of app.py. Anyone who forks this can retune the tutor by editing plain English, not code logic.
Conversation memory via Streamlit session state — follow-ups keep context.
Total running cost: $0.
Why open innovation matters for this build
I'm a caregiver learning to code on the side. I don't have a budget for AI APIs, and a learning tool that charges per question would teach me to stop asking questions — the exact opposite of learning.
Open weights fix that:
Asking is free. Every "wait, why?" costs nothing. A beginner can ask the dumb question, the follow-up, and the follow-up to the follow-up without a meter running. That's how slow-and-steady learning actually works.
No one can pull the plug. If a closed provider raises prices, retires a model, or changes terms, a closed-API tutor dies on their schedule. With open weights + an open router, when one free model is busy, the request goes to another — the app keeps working.
The tutor is forkable, not rented. The whole thing is one app.py and a prompt written in plain English. Another beginner can clone it, make it stricter, make it funnier, make it teach JavaScript instead — without asking anyone's permission. That's open innovation at the smallest, most personal scale: one learner's tool becomes the next learner's starting point.
This is my Week 1 and Week 2 lesson too, now for the third time: the auto-router is what makes free actually reliable. Openness isn't one model — it's having many, so no single point of failure can take your tool away.
What I'd do next
A "explain my error" paste box with even simpler language for total first-week beginners
Voice input — asking out loud is even lazier than typing, and helps on a phone
A "review what I learned" button that turns your chat history into 5 tiny recap cards
But the core promise is done: one question, one plain answer, one tiny example — back to your day. Slow and steady wins.
來源:DEV Community · dev.to