Python tkinter arrowshape是否需要元组但存储为文本?

Python tkinter arrowshape是否需要元组但存储为文本?,python,Python,我遇到了一个问题,因为从tkinter画布中拉出选项[“arrowshape”]会导致字符串“x y z”,而在create_行中设置arrowshape将使用元组[x,y,z],而不是字符串。。。 在Python 2.7.10+中是否正确这是创建箭头的方式: from tkinter import * root = Tk() can = Canvas(root, bg='white') ar = can.create_line(5, 5, 100, 70, arrow='last', ar

我遇到了一个问题,因为从tkinter画布中拉出选项[“arrowshape”]会导致字符串“x y z”,而在create_行中设置arrowshape将使用元组[x,y,z],而不是字符串。。。
在Python 2.7.10+中是否正确这是创建箭头的方式:

from tkinter import *

root = Tk()

can = Canvas(root, bg='white')
ar = can.create_line(5, 5, 100, 70, arrow='last', arrowshape='20 40 10')
can.pack()

root.mainloop()
您需要传递表示箭头形状的字符串(或列表或元组)。第一个是长度,最后一个是宽度,中间一个与箭头底部的弧度有关。你可以用它来品尝

也可以通过以下方式指定箭头形状:

arrowshape=[20, 40, 10]


你有什么问题?(PS:
[x,y,z]
是一个列表而不是元组)问题在于从画布中检索箭头形状数据时,它是字符串。非常感谢,我猜“20 40 10”也是Tkinter的内部存储格式
arrowshape=(20, 40, 10)