Python Static Function

python-static-function.png
#!/usr/bin/env python
#coding: UTF-8
import sys,os,math
sys.path.append("/Applications/Inkscape.app/Contents/Resources/extensions")
import inkex
class Circle():
    #static関数
    @classmethod
    def toSVGObject(cls,x,y,r,color,strokewidth):
        att={"cx":str(x),"cy":str(y),"r":str(r),"fill":color,"stroke-width":str(strokewidth)}
        return inkex.etree.Element("circle",att)

サポートサイト Wikidot.com