An AI-powered Python tutor that only speaks code. Ask her anything — she answers in Python. Type plain english? She'll send it back.
Girl Code is a web-based chat application where you learn Python through conversation. The AI responds to every message entirely in runnable Python code, using comments for explanations and print() statements to communicate. If you type plain english instead of code, she'll correct you.
Girl Code is powered by OpenAI's GPT API (a large language model). Here's the architecture:
- You type code → the Flask backend executes it in a sandboxed Python environment and captures the output
- Your code + output is sent to the GPT API along with a system prompt that tells the AI to respond only in valid Python code
- The AI generates a response — it's not pre-written. Every reply is created dynamically based on your conversation
- The response is executed too — so you see both the code and its output
- If you type plain english, a regex-based detector catches it and returns a correction before it ever hits the API
The system prompt defines Girl Code's personality and teaching rules: always respond in Python, show broken vs fixed code when errors happen, track concept progression, and end every reply with a challenge.
User Input → Code Detection → Execute Code → GPT API → Execute Response → Display
↓
Plain English? → Sassy Correction 💅
- Code-only responses — every reply is valid, runnable Python
- Code execution — responses are executed and output is displayed
- Plain english detection — type english and she'll tell you to try again in code
- Clean iPhone-style UI — modern, minimal chat interface
- Promo & demo pages — ready-made marketing assets
git clone https://github.com/dstaton2034/girl-code-ai.git
cd girl-code-aipip install -r requirements.txtCreate a .env file in the project root:
OPENAI_API_KEY=your-api-key-here
Get a key at platform.openai.com/api-keys
python app.pyOpen http://localhost:5000 in your browser.
| Page | URL | Description |
|---|---|---|
| Chat | / |
The main Girl Code chat interface |
- Python + Flask
- OpenAI API (GPT-3.5-turbo)
- HTML/CSS/JS (no frameworks)
MIT