猫史档案馆


【Python作品分享】中文海龟画图编辑器【求助帖】

用户:炸图监管者炸图监管者查看:0 回复:0 评论:0 创建时间:2021-05-11T21:13:12


【作品展示】

center_image

 

【作品介绍】

谁能改成一步到位?

 

【作品源代码】

import turtle
print("欢迎使用中文海龟画图编辑器")
print("支持语法:笔色 底色 移动 旋转 画板 粗细    输入帮助获取")

while True:
    a = input(">>>")
    if a == "画板":
        turtle.Pen()
        a = 0

    if a == "粗细":
        cu = input("粗细:")
        turtle.pensize(cu)
        a = 0
        cu = 1

    if a == "笔色":
        e = input('颜色[红/绿/蓝/橙/黄/黑/白/粉/紫]:')
        if e == "红":
            turtle.color('red')
        if e == '绿':
            turtle.color('green')
        if e == '蓝':
            turtle.color('blue')
        if e == '橙':
            turtle.color('orang')
        if e == '黄':
            turtle.color('yellow')
        if e == '黑':
            turtle.color('black')
        if e == '白':
            turtle.color('white')
        if e == '粉':
            turtle.color('pink')
        if e == '紫':
            turtle.color('purple')

    if a == '移动':
        bu = int(input('步数:'))
        turtle.fd(bu)
        bu = 0

    if a == '旋转':
        zhuan = int(input('度数:'))
        turtle.left(zhuan)

    if a == '底色':
        s = input('颜色[红/绿/蓝/橙/黄/黑/白/粉/紫]:')
        if s == '红':
            turtle.bgcolor('red')
        if s == '绿':
            turtle.bgcolor('green')
        if s == '蓝':
            turtle.bgcolor('blue')
        if s == '橙':
            turtle.bgcolor('orang')
        if s == '黄':
            turtle.bgcolor('yellow')
        if s == '黑':
            turtle.bgcolor('black')
        if s == '白':
            turtle.bgcolor('white')
        if s == '粉':
            turtle.bgcolor('pink')
        if s == '紫':
            turtle.bgcolor('purple')
            
    if a == '帮助':
        print("支持语法:笔色 底色 移动 旋转 画板 粗细")

 

【提示】

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

https://python.codemao.cn


回复

上一页1 页 / 共 0下一页