Skip to content

Commit 8e00fd9

Browse files
committed
feat: add cursor ai intro
1 parent 07ddf5a commit 8e00fd9

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

Diff for: 00-playground/40-cursor-ai-intro/writer.py

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
def write_file(filename: str, text: str):
2+
with open(filename, "w") as f:
3+
f.write(text)
4+
5+
def read_file(filename: str) -> str:
6+
with open(filename, "r") as f:
7+
return f.read()
8+
9+
def append_file(filename: str, text: str):
10+
with open(filename, "a") as f:
11+
f.write(text)
12+
13+
def parse_input(text: str) -> str:
14+
return text.strip('\n')
15+
16+
if __name__ == "__main__":
17+
# Get the input text from the user and store it in a file
18+
while True:
19+
input_text = input("Enter your text: ")
20+
append_file("output.txt", input_text)
21+
if input_text == "":
22+
break
23+
24+
print("File written successfully.")

Diff for: 00-playground/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,10 @@ For Stable Diffusion, you need to add your `STABILITY_AI_KEY`. You can find it i
153153
- writing a [short Python script](38-github-copilot-intro/db_backup.py) with suggestions and sidebar chat.
154154
- generating an [Express app](39-node-demo-project) with input validation.
155155

156+
## Introducing Cursor AI: Smart Suggestions, Chat & Composer
157+
158+
- writing a [Python script](40-cursor-ai-intro/writer.py) with Cursor AI.
159+
156160
These examples are based on four courses:
157161

158162
- [Mastering OpenAI Python APIs: Unleash the Power of GPT4](https://www.udemy.com/course/mastering-openai/) by Colt Steele (2023).

0 commit comments

Comments
 (0)