电子学会Python考前英语单词
1. 必会
常见
str int float bool
input print type import turtle
行走相关
forward backward goto
方向
setheading:设置画笔朝向 right left
笔与颜色
penup pendown pensize
pencolor fillcolor color bgcolor
begin_fill end_fill
颜色值:
red(红色) blue(蓝色) green(绿色) yellow(黄色)
orange(橙色) pink(粉色) black(黑色) white(白色)
圆
circle(radius, extent=None, steps=None):参数中的steps要记住,经常用
dot
重置
home clear reset
stamp(不常用,选择可能出):用于在屏幕上留下海龟形状的印记(或称为“邮票”)
clearstamp(不常用,选择可能出):清除ID
隐藏与显示
hideturtle showturtle
窗口
title
shape:箭头造型:arrow、turtle、circle、square、triangle、classic
screensize:设置画布宽度为width
,高度为height
,背景色为bg
setup:设置窗口大小和位置
其它
speed
done:完成绘图,暂停画笔绘制,不会关闭窗口,等待用户交互(如关闭窗口)
2. 不常用,但需要有印象
IDE IDLE
PyCharm:一个Python的编程软件
vscode、Visual Studio Code:是一个东西,可以编写Python
Jupyter Notebook:交互式环境
Python REPL:交互式环境
Notepad、Notepad++、Sublime:三个不同的文本编辑器,可以编写Python代码,但是不能运行
eval