python画箭头(用内置的函数)怎么画?
发布网友
发布时间:2022-04-30 17:55
我来回答
共1个回答
热心网友
时间:2022-04-23 02:48
你用的graphics模块?这不是内置的,虽然它是调用内置的Tkinter画图。
option可以是"first","last","both"或"none"。见graphics.py:
def setArrow(self, option):
if not option in ["first","last","both","none"]:
raise GraphicsError(BAD_OPTION)
self._reconfig("arrow", option)
细节要查Tk文档:
6.6. The canvas line object
In general, a line can consist of any number of segments connected end to end, and each segment can be straight or curved. To create a canvas line object on a canvas C, use:
id = C.create_line ( x0, y0, x1, y1, ..., xn, yn, option, ... )
The line goes through the series of points
(x0,
y0),
(x1,
y1),
…
(xn,
yn).
Options include:
arrow The default is for the line to have no arrowheads. Use
arrow=FIRST to get an arrowhead at the(x0,y0)end of the line. Use
arrow=LAST to get an arrowhead at the far end. Use
arrow=BOTH for arrowheads at both ends.