File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -122,20 +122,25 @@ Or in Python:
122122
123123.. code :: python
124124
125+
125126 import qrcode
126127 import qrcode.image.svg
127-
128+
129+ method = input (" What method? (basic, fragment, path): " )
130+
128131 if method == ' basic' :
129132 # Simple factory, just a set of rects.
130133 factory = qrcode.image.svg.SvgImage
131134 elif method == ' fragment' :
132- # Fragment factory (also just a set of rects )
135+ # Fragment factory (no standalone header )
133136 factory = qrcode.image.svg.SvgFragmentImage
134137 else :
135138 # Combined path factory, fixes white space that may occur when zooming
136139 factory = qrcode.image.svg.SvgPathImage
137-
140+
138141 img = qrcode.make(' Some data here' , image_factory = factory)
142+
143+ img.save(' some_file.svg' )
139144
140145 Two other related factories are available that work the same, but also fill the
141146background of the SVG with white::
You can’t perform that action at this time.
0 commit comments