A svgwrite python module is a tool by Manfred Moitzi. To install this python module uses Python 3.4 version. Then you need to install svgwrite with pip3.4:
| C:\Python34\Scripts>pip3.4.exe install svgwrite Collecting svgwrite Downloading svgwrite-1.1.6.tar.gz (109kB) 100% |################################| 110kB 354kB/s |
This svgwrite is the only module that needs to be imported and then you can deal with this module. See this simple example:
| import svgwrite from svgwrite import * #this will work with svgwrite svg_doc = svgwrite.Drawing(filename = "test-svgwrite.svg",\ size = ("30px", "30px"))\ svg_doc.add(svg_doc.rect(insert = (0, 0),\ size = ("20px", "20px"),\ stroke_width = "1",\ stroke = "green",\ fill = "rgb(255,255,0)"))\ print(svg_doc.tostring()) svg_doc.save() |
The result of… Read More »