本文整理汇总了Python中elementtree.ElementTree.Element.attrib['stroke-width']方法的典型用法代码示例。如果您正苦于以下问题:Python Element.attrib['stroke-width']方法的具体用法?Python Element.attrib['stroke-width']怎么用?Python Element.attrib['stroke-width']使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类elementtree.ElementTree.Element
的用法示例。
在下文中一共展示了Element.attrib['stroke-width']方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: timinggrid
# 需要导入模块: from elementtree.ElementTree import Element [as 别名]
# 或者: from elementtree.ElementTree.Element import attrib['stroke-width'] [as 别名]
def timinggrid(self):
"""
This function uses the signalcnt, cycles, period, height, and spacing
to draw the light lines that will be the clock lines.
"""
gelem = Element("g") # create a group
for i in range(int(self.cycles)):
lelem = Element("line")
lelem.attrib['x1'] = str(i*self.period + self.period/2.0 + self.xzero)
lelem.attrib['y1'] = str(0);
lelem.attrib['x2'] = str(i*self.period + self.period/2.0 + self.xzero)
lelem.attrib['y2'] = str(self.signalcnt*(self.height + self.signalspacing) + self.signalspacing)
lelem.attrib['stroke'] = "grey"
lelem.attrib['stroke-width'] = "0.5"
gelem.append(lelem)
self.svgelem.append(gelem)
self.svgelem.append(self.signalselem)