Created
July 19, 2012 05:59
-
-
Save Superbil/3141068 to your computer and use it in GitHub Desktop.
use pyswf to convert to svg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys | |
if len(sys.argv) > 1: | |
file_name = sys.argv[1] | |
else: | |
print "no input file name" | |
exit() | |
from swf.movie import SWF | |
from swf.export import SVGExporter | |
# create a file object | |
file = open(file_name, 'rb') | |
# load and parse the SWF | |
swf = SWF(file) | |
# create the SVG exporter | |
svg_exporter = SVGExporter() | |
# export! | |
svg = swf.export(svg_exporter) | |
# save the SVG | |
open(file_name+'.svg', 'wb').write(svg.read()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment