小编abh*_*era的帖子

如何在 tkinter 画布上绘制弧线?

我正在学习自动机理论,我被要求编写一个看起来或多或少类似于的自动机的图(树):

这个

到目前为止,我得到了这个(我正在使用tkintercanvas绘制):

from tkinter import Tk, Canvas, mainloop

def circle(canvas, x, y, r, width):
   id = canvas.create_oval (x-r, y-r, x+r, y+r, width = width)
   return id

def line (canvas, x1, y1, x2, y2, width):
    canvas.create_line (x1, y1, x2, y2, width = width)

def text (canvas, x, y, text):
    canvas.create_text (x, y, text = text, font = ("bold", 20))

w = Canvas(Tk (), width=1000, height=600, bg = "white")

circle (w , 150, 300, 70, 3)
circle (w …
Run Code Online (Sandbox Code Playgroud)

python graphics tree canvas tkinter

5
推荐指数
1
解决办法
7643
查看次数

标签 统计

canvas ×1

graphics ×1

python ×1

tkinter ×1

tree ×1