> Source URL: /resources/cursor.resource
# Cursor

## What It Is

Cursor is a code editor (like VS Code) with built-in AI features. In this course, you’ll use Cursor to write Python programs, run them in the terminal, and get help understanding errors and improving your code.

## Why We Use It

Cursor helps beginners because it gives you:

- A clean place to write code (with syntax highlighting and autocomplete)
- A built-in terminal so you can run Python without switching apps
- AI help for explaining code, debugging errors, and suggesting improvements

Think of it like having a practice facility + film room + assistant coach in one place.

---

## How to Use It

### Create and Save a Python File

1. **New file:** File → New File (or `Cmd + N` on Mac, `Ctrl + N` on Windows/Chromebook)
2. **Save it:** File → Save (or `Cmd + S` on Mac, `Ctrl + S` on Windows/Chromebook)
3. **Name it with `.py`**, like `achievement.py`

### Open the Terminal

Use **View > Terminal** from the menu bar, or use a keyboard shortcut:

- **Mac:** `Cmd + ~`
- **Windows/Chromebook:** `Ctrl + ~`

In the terminal, you can run:

```bash
python achievement.py
```

If that doesn’t work, try:

```bash
python3 achievement.py
```

### Use AI Help (Safely)

Good ways to use AI in this class:

- Ask: “Explain what this line does”
- Ask: “Why am I getting this error?”
- Ask: “Show me a simpler version of this code”

When AI suggests code:

- **Read it before you run it**
- **Run it in small steps**
- **Keep the code yours** (you should be able to explain what it does)

If you ask AI to change your code (especially if it suggests changing a lot), keep it simple:

- **Get the plan first**: “Tell me your plan before you change anything.”
- **You approve edits**: “Don’t edit files until I say ‘yes’.”
- **Small win only**: “Change one small thing, then stop so I can check it.”
- **Explain it fast**: “What did you change, and why?”
- **Run your code** after each small change so you can spot problems right away.

Copy/paste prompts:

- “Plan first. Ask before you edit any files.”
- “Only change 5–10 lines (or one function), then wait.”
- “Show the exact lines you changed (before and after).”

---

## Common Pitfalls

| Problem                      | What’s happening                  | Fix                                               |
| ---------------------------- | --------------------------------- | ------------------------------------------------- |
| “It ran but nothing printed” | Your code doesn’t call `print()`  | Add `print(...)` statements                       |
| “File not found”             | Terminal is in a different folder | `cd` into the right folder (or use the full path) |
| Forgot to save               | Terminal runs the old version     | Save (File → Save) before running                 |
| AI changed too much          | Hard to understand what happened  | Revert, then ask for a smaller change             |

---

## Quick Reference

| Action   | Menu               | Mac                                           | Windows/Chromebook |
| -------- | ------------------ | --------------------------------------------- | ------------------ |
| New file | File → New File    | `Cmd + N`                                     | `Ctrl + N`         |
| Save     | File → Save        | `Cmd + S`                                     | `Ctrl + S`         |
| Terminal | View → Terminal    | `Cmd + ~`                                     | `Ctrl + ~`         |
| Run code | (type in terminal) | `python filename.py` or `python3 filename.py` |                    |


---

## Backlinks

The following sources link to this document:

- [Cursor](/resources/index.resources.llm.md)
- [Cursor Guide](/ai-and-enterainment/weeks/week-3.module.llm.md)
- [Cursor](/resources/vibe-coding-platforms.resource.llm.md)
- [Cursor Guide](/users/annie-h/week-5.path.llm.md)
- [Cursor Guide](/users/charlie-m/week-5.path.llm.md)
- [Cursor Guide](/users/emily-kate-s/week-5.path.llm.md)
- [Cursor Guide](/users/josiah-c/week-5.path.llm.md)
- [Cursor Guide](/users/john-p/week-5.path.llm.md)
- [Cursor Guide](/users/jake-f/week-5.path.llm.md)
- [Cursor Guide](/users/elizabeth-b/week-5.path.llm.md)
- [Cursor Guide](/users/annie-h/week-4.path.llm.md)
- [Cursor Guide](/users/charlie-m/week-4.path.llm.md)
- [Cursor Guide](/users/elizabeth-b/week-4.path.llm.md)
- [Cursor Guide](/users/josiah-c/week-4.path.llm.md)
- [Cursor Guide](/users/emily-kate-s/week-4.path.llm.md)
- [Cursor Guide](/users/john-p/week-4.path.llm.md)
- [Cursor Guide](/users/jake-f/week-4.path.llm.md)
