Python Tutor Bot is a beginner-friendly educational AI app built with Python, Gradio, and the OpenAI Python SDK.
It helps learners:
- Understand Python concepts
- Debug code and errors
- Practice with quizzes
- Improve code quality
- Clean Gradio interface
- Four learning modes:
- Explain Concept
- Debug Code
- Quiz Me
- Improve Code
- Reusable prompt templates (
prompts.py) - Error handling for empty input and missing API key
- Simple modular structure for beginners
app.py— Gradio UI and main logicprompts.py— Prompt templates and prompt builderrequirements.txt— Dependencies.env— Store your OpenAI API key
- Clone the repo and open the project folder.
- Create a virtual environment (recommended):
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\\Scripts\\activate- Install dependencies:
pip install -r requirements.txt- Set your API key in
.env:
OPENAI_API_KEY=your_openai_api_key_herepython app.pyThen open the local Gradio URL shown in your terminal.
- Start with Explain Concept mode to learn basics.
- Use Debug Code by pasting both your code and error message.
- In Quiz Me, you can ask for topics like
loops,functions, ordictionaries. - In Improve Code, paste your code and review suggestions step by step.