猫史档案馆


【Python作品分享】set【作品秀】

用户:RainDawn_SATARainDawn_SATA查看:0 回复:0 评论:0 创建时间:2021-07-09T21:54:30


【作品展示】

center_image

 

【作品介绍】

turtle

常见初始准备

请看清函数变量的格式使用

注意:hide只能为0或1

0:隐藏海龟

1:显示海龟

用法:

import turtle as t

from set import Setup

Setup.setup(.........)

...............................

 

【作品源代码】

import turtle as t

class Setup():
    def __init__(self):
        pass

    def setup(speed:int,pensize:int,bgcolor:str,pencolor:str,screen_width:int,screen_hight:int,hide:int):
        t.speed(int(speed))
        t.pensize(int(pensize))
        t.bgcolor(str(bgcolor))
        t.pencolor(str(pencolor))
        t.screensize(int(screen_width), int(screen_hight))
        if hide==0:
            t.hideturtle()
        elif hide==1:
            t.showturtle()


if __name__=="__main__":
    Setup.setup(0,3,"black","white",400,400,1)
    t.done()

 

【提示】

部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:

https://python.codemao.cn


回复

上一页1 页 / 共 0下一页