-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
- 安装Python3
- 安装Visual Studio Code
未添加安装目录的会出现以下turtle库无法被识别的情况
import turtle
piers = turtle.Turtle()
**turtle**.pensize(4)
**turtle**.pencolor('red')
会报错
3.在VS中选择文件夹后需要在launch.json中加入以下代码,声明Python的安装目录:
"pythonPath": "E:\Programs\Python\Python37-32\python.exe",
注意,需要使用双斜杠,不然会报错
4.同时,在 settings.json中也会自动添加一个路径

5.注意使用的名字就不会报错了
print("hello word22223333")
import turtle
piers = turtle.Turtle()
piers.pensize(4)
piers.pencolor('red')
piers.forward(100)
piers.right(90)
piers.forward(100)
piers.right(90)
piers.forward(100)
piers.right(90)
piers.forward(100)
Metadata
Metadata
Assignees
Labels
No labels
