Skip to content

Commit e76faea

Browse files
committed
Merge branch '417'
2 parents 6a030f6 + b8893c4 commit e76faea

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

README.rst

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff 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
141146
background of the SVG with white::

0 commit comments

Comments
 (0)