猫史档案馆


RainDawn_SATA

RainDawn_SATA

Lv.1

获赞:14收藏:1浏览:94作品收藏:0
回复帖子评论
上一页1 页 / 共 1下一页

【Python作品分享】for_set_expanse 2.0【作品秀】 中回复

OOOOOOOOOOOOOOOOOOO:

import turtle as t

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

def setup(speed:int,pensize:int,bgcolor:str,pencolor:str,fillcolor: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.fillcolor(str(fillcolor))
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","white",400,400,0)
t.done()

你把这个复制后用set这个名称保存下来与这个代码文件放同一个文件夹试试

或者用这个试试:

import turtle as t
class setExpanse(): def set_ex(): bgcolor = t.textinput('write your backgroudcolor', 'write your backgroudcolor(string)[you have to write by yourself]') pencolor = t.textinput('write your pencolor', 'write your pencolor(string)[you have to write by yourself]') fillcolor = t.textinput('write your fillcolor', 'write your fillcolor(string)[you have to write by yourself]') y_n = t.textinput('Do you want to hide the turtle', 'Do you want to hide the turtle(yes/no)') pensize = t.numinput('write your pensize', 'wirte your pensize(must be num)[be careful if you want to set the high num]') pen_speed = t.numinput('write the speed of your pen', 'wirte the speed of your pen(must be num)[I hope you can choose from 0 to 3]')
if y_n == "yes"or y_n == "y": y_n = 0 elif y_n == "no"or y_n == "n": y_n = 1
hide = y_n t.speed(int(pen_speed)) t.pensize(int(pensize)) t.bgcolor(str(bgcolor)) t.pencolor(str(pencolor)) t.fillcolor(str(fillcolor)) t.screensize(400, 400) if hide == 0: t.hideturtle() elif hide == 1: t.showturtle()


if __name__ == "__main__": setExpanse.set_ex() t.done()

2021-08-09T20:30:08 点赞:0

【Python作品分享】set 2.0【作品秀】 中回复

center_image

2021-08-09T20:35:25 点赞:0

【Python作品分享】set 2.0【作品秀】 中回复

回wwwload

2021-08-09T20:36:01 点赞:0

第一个gcx文件 中回复

这个得怪LICEcapcenter_image

2021-08-10T19:18:49 点赞:0

第一个gcx文件 中回复

center_image

2021-08-10T19:20:42 点赞:0

第一个gcx文件 中回复

center_image

2021-08-10T19:21:25 点赞:0

原创「请勿转载」 中回复

《Raindrop》

2022-07-09T22:42:03 点赞:0

四叶喵预告(正在做呢)😁最近有点忙事多 可能会很慢「如果想看完整版就点个赞 谢谢」 中回复

如果有错可以发在评论里哦

如果有大佬想帮忙也可以在评论里反馈哦

2023-01-10T21:00:52 点赞:2

【Python作品分享】四叶喵Arcade _Painting更新进度报告【作品秀】 中回复

各位大佬如果有什么建议可以发表评论哦

2023-01-14T21:15:49 点赞:1