Atty is a multilingual Python learning tool that lets beginners write Python-style code using their native language and run it directly. It currently supports Korean, Spanish, and Farsi, translating native keywords into standard Python before execution.
Built for the BCIT Hackathon!
Most beginner programming tools assume the learner already understands English. Atty lowers the barrier to entry by allowing learners to write familiar control flow (if, for, while) and built-in functions (print, input) in their own language, while still leveraging the full power of Python under the hood.
In addition to multilingual coding, Atty also includes interactive learning features inside VS Code. These features help users gradually learn Python keywords in another language through quizzes and interactive translation while writing real code.
- Native Language Coding: Write code using translated keywords in Korean, Spanish, or Farsi.
- Auto-Language Detection: Atty automatically detects the language of a source file based on keyword weighting.
- Seamless Execution: Translates code into standard Python and executes it instantly in memory.
- VS Code Extension: Run code directly from the editor with a custom "Play" button, and enjoy native syntax highlighting via our custom
.tmLanguage.jsonTextMate grammar. - Interactive Typing Quiz: While writing Python code, Atty can quiz the user on Python keywords by showing multiple-choice translations in the selected language. Correct answers automatically replace the keyword in the editor.
- Learning Mode: Scan an existing Python file and quiz the user on detected Python keywords one by one, helping learners reinforce vocabulary while working with real code.
- Multi-Language Learning Support: Users can select their working language (Korean, Spanish, or Persian), and the extension dynamically loads the corresponding dictionary.
- CLI Tool: Run
atty file.attydirectly from your terminal. - Export to Python: Optionally export your code to a standard English
.pyfile to share with others. - Built-in Linter Rules: Helps beginners catch common syntax mistakes early with specific checks like
syntaxMissingColonandcompareNone. - AI Error Explanations (Zero-Dependency): Automatically catches Python tracebacks and sends them to the Gemini 2.5 Flash API to generate a beginner-friendly explanation in the user's native language.
atty/
├── setup.py
├── atty_interpreter.py
├── package.json
├── .env # (You create this for the Gemini API key)
├── src/
│ └── extension.ts # VS Code extension logic
├── dicts/
│ ├── kr_en.json
│ ├── es_en.json
│ └── fa_en.json
└── syntaxes/
└── atty.tmLanguage.json
You can install the Atty VS Code extension directly from our GitHub Releases page!
- Go to the Releases page on this repository.
- Download the latest
atty-1.0.0.vsixfile. - Open VS Code, go to the Extensions tab (
Ctrl+Shift+X). - Click the three dots (
...) in the top right corner of the Extensions panel. - Select Install from VSIX... and choose the downloaded file.
- Note: You will still need to follow Step 3 below to get AI Error Explanations working!
Install the interpreter in editable mode so you can run it from anywhere on your machine:
git clone <your-repo-url>
cd atty
pip install -e .Atty uses Google's Gemini to explain coding errors to beginners. We built this to be zero-dependency—it uses Python's built-in urllib, so you don't need to install any heavy AI packages!
- Get a free API key from Google AI Studio.
- Create a file named
.envin the root folder of the project. - Add your key to the file:
GEMINI_API_KEY=your_actual_api_key_here
Once the extension is installed, using Atty is incredibly easy:
- Open any
.attyfile in VS Code. You will instantly see your native language keywords light up with our custom syntax highlighting. - To Run Code: Look at the top-right corner of the editor window. Click the Play Button (▶) to execute your file. The output (and any AI-translated errors) will print directly into the VS Code Output panel at the bottom of your screen.
- To Export Code: Click the Save-As Button (💾) right next to the Play button. This will automatically generate a standard English
.pyfile right next to your original script, containing the fully translated code!
(Alternatively, you can right-click any .atty file in the left sidebar and select Atty: Export to Python (.py)).
If you prefer the terminal, you can run files just like standard Python:
# Run a translated script
atty path/to/file.atty
# Export the translated English Python file (doesn't execute, just translates)
atty path/to/file.atty --output-pyAtty includes interactive learning features inside the VS Code extension such as typing quizzes, inline hints, and a learning mode.
Feature 1: Select Working Language Before using the quiz or learning features, select a working language.
Open the Command Palette: Ctrl + Shift + P
Run: "Select Working Language"
Choose one of the supported languages: Korean Spanish Farsi
The selected language determines which dictionary the extension uses for translations.
Typing Quiz Mode quizzes the user while they are writing ** Python ** code.
How it works: When a user types an English Python keyword and finishes the word using a trigger character (such as space or (), the extension displays a multiple-choice quiz asking for the correct translation. If the user selects the correct answer, the English keyword is replaced with the translated word.
Example:
If the selected language is Korean and the user types something like: print(
then a quiz popup will appear with translation choices.
Selecting the correct option replaces the word: 출력( Suggested words to test print if for return def else while input
Learning Mode scans the current Python file and quizzes the user on detected ** Python ** keywords. How to run it
Open a Python file such as: def greet(): print("Hello")
if True: for i in range(3): print(i) else: return
Open the Command Palette and run: "Start Learning Mode" The extension will ask translation questions one keyword at a time. Correct answers replace the English keywords in the file.
- Open any
.attyfile in VS Code. You will see native syntax highlighting! - Click the Play button in the top right of the editor to run the code, or the Save As button to export it to
.py. Output prints directly to the VS Code Output panel.
- Weighted Language Detection: Since a single letter like
ymeans "and" in Spanish but could be a variable in Farsi, the language detection algorithm weights matches by character length to guarantee accuracy. - RTL Terminal Fixes: Standard developer terminals print Arabic/Farsi characters backwards and disconnected. Atty intercepts Farsi AI translations and uses character-level reversal to ensure they render perfectly Right-to-Left in standard English consoles.
- Prompt Engineering: The Gemini prompt dynamically adjusts based on the language. For Korean, it explicitly instructs the model to use natural, conversational politeness levels (
해요체or합쇼체) rather than robotic technical jargon.
### Spanish (`demo_es.atty`)
```python
imprimir("¡Hola Mundo!")
edad = 20
si edad > 18:
imprimir("Eres un adulto.")
sino:
imprimir("Eres menor.")
출력("안녕 세상!")
반복 i 안에 범위(3):
출력("카운트다운:", i)چاپ("سلام دنیا!")
اگر درست:
چاپ("به هکاتون خوش آمدید!")