Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/360.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用python空闲图形制作不规则形状_Python - Fatal编程技术网

如何使用python空闲图形制作不规则形状

如何使用python空闲图形制作不规则形状,python,Python,这是我的代码,我需要用python中的循环重写它。如果必要,我必须使用for或while循环、oh和条件语句(if和elif)既然没有一致性或模式,就没有办法在循环中实现……为什么不使用坐标列表呢? pt1 = Point(280,49) pt2 = Point(279,62) pt3 = Point(276,86) pt4 = Point(274,114) pt5 = Point(273,126) pt6 = Point(271,153) pt7 = Point(269,166) pt8 =

这是我的代码,我需要用python中的循环重写它。如果必要,我必须使用for或while循环、oh和条件语句(if和elif)

既然没有一致性或模式,就没有办法在循环中实现……为什么不使用坐标列表呢?
pt1 = Point(280,49)
pt2 = Point(279,62)
pt3 = Point(276,86)
pt4 = Point(274,114)
pt5 = Point(273,126)
pt6 = Point(271,153)
pt7 = Point(269,166)
pt8 = Point(268,179)
pt9 = Point(267,192)
pt10 = Point(266,206)
pt11 = Point(265,213)
pt12 = Point(264,223)
pt13 = Point(264,230)
pt14 = Point(262,238)
pt15 = Point(256,238)
pt16 = Point(244,238)
pt17 = Point(235,239)
pt18 = Point(226,238)
pt19 = Point(223,236)
pt20 = Point(226,222)

ferb = Polygon     (pt1,pt2,pt3,pt4,pt5,pt6,pt7,pt8,pt9,pt10,pt11,pt12,pt13,pt14,pt15,pt16,pt17,pt18,pt19,pt20).