Python Turtle 计量单位 [英] Python Turtle unit of measurement

查看:45
本文介绍了Python Turtle 计量单位的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我们实例化一个海龟对象时,我们可以画一个圆.我想知道 circle() 方法的半径参数.

When we instantiate a turtle object, we can draw a circle. I wonder about the radius parameter of the circle() method.

import turtle
myTurtle = turtle.Turtle()
myTurtle.circle(50)

这个参数的计量单位是什么?

What is the unit of measurement of this parameter?

半径等于 50 像素还是 50 英寸?

Does the radius equal to 50 pixels or 50 inches?

推荐答案

turtle.setup 的文档表明大小参数,如果表示为整数,则是像素,如果表示为浮点数,则是屏幕的分数.

the documentation for turtle.setup indicates that size parameters, if expressed as integers, are pixels, if expressed as floats, are fractions of the screen.

这篇关于Python Turtle 计量单位的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆