Linux Python svgwrite中的SVG在Ubuntu中不显示,但在Windows 7中显示
我使用下面的代码使用Python 2.7生成条形码和SVG图形。在Windows7机器上,脚本执行良好,SVG文件被创建,我可以在Windows上使用Inkscape查看它们 我可以使用Ubuntu运行代码(更改路径),脚本执行时不会出错。当我尝试在Ubuntu上使用Inkscape打开SVG文件时,SVG文件显示为空白。如果我将Ubuntu生成的文件移动到Windows机器上,它们看起来很好。 我是Linux新手,在关闭或完成SVG文件时,我缺少的代码中是否有Windows不需要的内容,或者这只是Ubuntu Inkscape的一个bugLinux Python svgwrite中的SVG在Ubuntu中不显示,但在Windows 7中显示,linux,python-2.7,svg,Linux,Python 2.7,Svg,我使用下面的代码使用Python 2.7生成条形码和SVG图形。在Windows7机器上,脚本执行良好,SVG文件被创建,我可以在Windows上使用Inkscape查看它们 我可以使用Ubuntu运行代码(更改路径),脚本执行时不会出错。当我尝试在Ubuntu上使用Inkscape打开SVG文件时,SVG文件显示为空白。如果我将Ubuntu生成的文件移动到Windows机器上,它们看起来很好。 我是Linux新手,在关闭或完成SVG文件时,我缺少的代码中是否有Windows不需要的内容,或者这
import sys, traceback
import barcode
import svgwrite
ean = barcode.get('ean8', '16031601')
filename = ean.save('Z:/GISpublic/GerryG/PythonScripts/Barcode/ean8')
options = dict(font_size = 0, module_height = 8, module_width = 1)
filename = ean.save('ean8', options)
#Create the arrowhead in a new svg drawing.
dwg = svgwrite.Drawing('Z:/GISpublic/GerryG/PythonScripts/Barcode/arrowhead.svg')
triangle = dwg.add(dwg.polygon([(280,-15), (280,48),(300,17),(280,-15)], fill='black'))
dwg.save()
我不清楚在什么情况下会出现问题。将Inkscape更新到版本0.92(从0.91)似乎已经解决了问题。在这个新版本下,SVG文件看起来不错。