Skip to content

Commit c6f28e4

Browse files
Update README.rst
Define variable method inside this example making the example work
1 parent 1a2c213 commit c6f28e4

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

README.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,12 @@ Or in Python:
122122

123123
.. code:: python
124124
125+
125126
import qrcode
126127
import qrcode.image.svg
127-
128+
129+
method = input("What method?: ")
130+
128131
if method == 'basic':
129132
# Simple factory, just a set of rects.
130133
factory = qrcode.image.svg.SvgImage
@@ -134,8 +137,10 @@ Or in Python:
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)