1
+ {
2
+ "cells" : [
3
+ {
4
+ "cell_type" : " markdown" ,
5
+ "metadata" : {},
6
+ "source" : [
7
+ " # Qbar Code generator using python"
8
+ ]
9
+ },
10
+ {
11
+ "cell_type" : " markdown" ,
12
+ "metadata" : {},
13
+ "source" : [
14
+ " ## Installing libraries"
15
+ ]
16
+ },
17
+ {
18
+ "cell_type" : " code" ,
19
+ "execution_count" : 2 ,
20
+ "metadata" : {},
21
+ "outputs" : [
22
+ {
23
+ "output_type" : " stream" ,
24
+ "name" : " stdout" ,
25
+ "text": "Collecting pyqrcode\n Downloading https://files.pythonhosted.org/packages/37/61/f07226075c347897937d4086ef8e55f0a62ae535e28069884ac68d979316/PyQRCode-1.2.1.tar.gz\nBuilding wheels for collected packages: pyqrcode\n Building wheel for pyqrcode (setup.py) ... \u001b[?25ldone\n\u001b[?25h Created wheel for pyqrcode: filename=PyQRCode-1.2.1-cp37-none-any.whl size=36245 sha256=347b59e838d0efc77ba9576eb9e4a3aed2eacb8df90aa1c394c07d0c06587527\n Stored in directory: /home/its-k/.cache/pip/wheels/54/61/2f/a4f51b09473db5737db0f654ed10eb9a4ee01f83a7412de349\nSuccessfully built pyqrcode\nInstalling collected packages: pyqrcode\nSuccessfully installed pyqrcode-1.2.1\nCollecting pypng\n\u001b[?25l Downloading https://files.pythonhosted.org/packages/bc/fb/f719f1ac965e2101aa6ea6f54ef8b40f8fbb033f6ad07c017663467f5147/pypng-0.0.20.tar.gz (649kB)\n\u001b[K |████████████████████████████████| 655kB 516kB/s \n\u001b[?25hBuilding wheels for collected packages: pypng\n Building wheel for pypng (setup.py) ... \u001b[?25ldone\n\u001b[?25h Created wheel for pypng: filename=pypng-0.0.20-cp37-none-any.whl size=67164 sha256=fb166716a155daee44d95fb868658045f4b96729a5640ba1050e0d13badf10bf\n Stored in directory: /home/its-k/.cache/pip/wheels/41/6b/ef/0493b536b6d4722c2ae9486691b1d49b922b9877922beeabb3\nSuccessfully built pypng\nInstalling collected packages: pypng\nSuccessfully installed pypng-0.0.20\n"
26
+ }
27
+ ],
28
+ "source" : [
29
+ " !pip install pyqrcode\n " ,
30
+ " !pip install pypng"
31
+ ]
32
+ },
33
+ {
34
+ "cell_type" : " markdown" ,
35
+ "metadata" : {},
36
+ "source" : [
37
+ " ## importing libraries"
38
+ ]
39
+ },
40
+ {
41
+ "cell_type" : " code" ,
42
+ "execution_count" : 11 ,
43
+ "metadata" : {},
44
+ "outputs" : [],
45
+ "source" : [
46
+ " import pyqrcode\n " ,
47
+ " import png \n " ,
48
+ " from pyqrcode import QRCode"
49
+ ]
50
+ },
51
+ {
52
+ "cell_type" : " markdown" ,
53
+ "metadata" : {},
54
+ "source" : [
55
+ " ## String to represent QRcode"
56
+ ]
57
+ },
58
+ {
59
+ "cell_type" : " code" ,
60
+ "execution_count" : 16 ,
61
+ "metadata" : {},
62
+ "outputs" : [],
63
+ "source" : [
64
+ " s = \" https://www.google.com/search?q=%23its_Kumar\" "
65
+ ]
66
+ },
67
+ {
68
+ "cell_type" : " markdown" ,
69
+ "metadata" : {},
70
+ "source" : [
71
+ " ## Generate QRCode"
72
+ ]
73
+ },
74
+ {
75
+ "cell_type" : " code" ,
76
+ "execution_count" : 17 ,
77
+ "metadata" : {},
78
+ "outputs" : [],
79
+ "source" : [
80
+ " qr = pyqrcode.create(s)\n "
81
+ ]
82
+ },
83
+ {
84
+ "cell_type" : " code" ,
85
+ "execution_count" : 25 ,
86
+ "metadata" : {},
87
+ "outputs" : [
88
+ {
89
+ "output_type" : " execute_result" ,
90
+ "data" : {
91
+ "text/plain" : " QRCode(content=b'https://www.google.com/search?q=%23its_Kumar', error='H', version=5, mode='binary')"
92
+ },
93
+ "metadata" : {},
94
+ "execution_count" : 25
95
+ }
96
+ ],
97
+ "source" : [
98
+ " qr"
99
+ ]
100
+ },
101
+ {
102
+ "cell_type" : " code" ,
103
+ "execution_count" : 29 ,
104
+ "metadata" : {},
105
+ "outputs" : [
106
+ {
107
+ "output_type" : " execute_result" ,
108
+ "data" : {
109
+ "text/plain" : " b'https://www.google.com/search?q=%23its_Kumar'"
110
+ },
111
+ "metadata" : {},
112
+ "execution_count" : 29
113
+ }
114
+ ],
115
+ "source" : [
116
+ " # check data \n " ,
117
+ " qr.data"
118
+ ]
119
+ },
120
+ {
121
+ "cell_type" : " code" ,
122
+ "execution_count" : 24 ,
123
+ "metadata" : {},
124
+ "outputs" : [
125
+ {
126
+ "output_type" : " execute_result" ,
127
+ "data" : {
128
+ "text/plain": "'000000000000000000000000000000000000000000000\\n000000000000000000000000000000000000000000000\\n000000000000000000000000000000000000000000000\\n000000000000000000000000000000000000000000000\\n000011111110110101111111100101111011111110000\\n000010000010000001110000010111011010000010000\\n000010111010011001000011011000100010111010000\\n000010111010111111100010011100010010111010000\\n000010111010010100001100100110011010111010000\\n000010000010010010010001000101111010000010000\\n000011111110101010101010101010101011111110000\\n000000000000011111111001111001101000000000000\\n000000101110101000011101110111010100010010000\\n000010001000001101001010000100001010010110000\\n000001100011010010111101010001000010100010000\\n000010111100010001000100000011100100010000000\\n000010011110001000000010011011011110010100000\\n000000111001110000110010000110101010011110000\\n000001111110001011100000101101000101101010000\\n000011001001100100101100111001000010000010000\\n000010110111010110110001101011001110010110000\\n000001111000001001000101000100001110001110000\\n000011110011010110101010110101001011000110000\\n000001110100110110001110000111111000100100000\\n000000111011001100111011011001011111000100000\\n000010100101111000000111100010100010001010000\\n000011000010101011001001110010001010110010000\\n000000001100111010011101110011100010000000000\\n000000100010000111101111010111011111010110000\\n000000111001110111101010100101011000010110000\\n000010110010001011001001110011000011110110000\\n000001100101010100111001111001101011100010000\\n000010001011101011110100001011011111100100000\\n000000000000110011000011011001111000100010000\\n000011111110000000100111010001111010101110000\\n000010000010100101001110111111101000100010000\\n000010111010110100110101110101001111110110000\\n000010111010010111110111010011011101100110000\\n000010111010111000100001101000101101110010000\\n000010000010001010100000111101111000100100000\\n000011111110001110001110110001111100100110000\\n000000000000000000000000000000000000000000000\\n000000000000000000000000000000000000000000000\\n000000000000000000000000000000000000000000000\\n000000000000000000000000000000000000000000000\\n'"
129
+ },
130
+ "metadata" : {},
131
+ "execution_count" : 24
132
+ }
133
+ ],
134
+ "source" : [
135
+ " qr.text()"
136
+ ]
137
+ },
138
+ {
139
+ "cell_type" : " markdown" ,
140
+ "metadata" : {},
141
+ "source" : [
142
+ " ## Create and save file"
143
+ ]
144
+ },
145
+ {
146
+ "cell_type" : " code" ,
147
+ "execution_count" : 19 ,
148
+ "metadata" : {},
149
+ "outputs" : [],
150
+ "source" : [
151
+ " qr.svg('qrcode.svg', scale=8)"
152
+ ]
153
+ },
154
+ {
155
+ "cell_type" : " code" ,
156
+ "execution_count" : 20 ,
157
+ "metadata" : {},
158
+ "outputs" : [],
159
+ "source" : [
160
+ " qr.png('qrcode.png', scale=6)"
161
+ ]
162
+ },
163
+ {
164
+ "cell_type" : " markdown" ,
165
+ "metadata" : {},
166
+ "source" : [
167
+ " ## Displaying the QRCode"
168
+ ]
169
+ },
170
+ {
171
+ "cell_type" : " code" ,
172
+ "execution_count" : 21 ,
173
+ "metadata" : {},
174
+ "outputs" : [],
175
+ "source" : [
176
+ " from IPython.display import Image"
177
+ ]
178
+ },
179
+ {
180
+ "cell_type" : " code" ,
181
+ "execution_count" : 22 ,
182
+ "metadata" : {},
183
+ "outputs" : [
184
+ {
185
+ "output_type" : " execute_result" ,
186
+ "data" : {
187
+ "image/png" : " iVBORw0KGgoAAAANSUhEUgAAAQ4AAAEOAQAAAABQysQIAAAB60lEQVR4nO2YUW7EIAxELXGAHImrcyQOgOS1ZyABrdT9nioRaml4/SC2hzHmv55hL/IiL/IbsXyqXW1gVjwnpXMuicRv7xX7yz/H1QIveKOK9NhiHVbHFazFJP+j1/gS0giD6cnGy/YPkIheJukVoWs5pBEk5sCiY6DUvnNXBmEA4905vvVFBllCPrUw8IEAbgKvhjAHM24phBwRVQRWEikzNy3fAcyXKD5RBIrOdbu3G1+iPKUmhmDFxxqexVfvuSSC8qKzwJGVpglUE0UihknBUwBsVMSxyaEWMpahyJ+IKmIIUBO5rURS18xKPw9hLSR3aYZdGmO4wCaKMAHplVBejfqBhJVEIi0h8LPCqPHzA2giiKEbgoZqazR98LaSSIYrhdA4QXeYlMsi9ETUQiZp6bPTLZqI0RZBM3h2kbLLRRFSaGrpzf1xGaIIgwa7ZFB6GCXbBF4OsbldNrvRuHNRFil0fFti0gaaLEL9y+O3b417t7PLUkLKdqtH08fE3I4sMeTRj3XtOmXedzlUQowNh7MjRLeBK71yWD8lhE4WmuFURF64nokphTArUWpj3X4ld+iLHkK7dxtbrGsjy0q0MsW+bUZJDfHpLHBD6dx6ORoOMWSKB6QiSw3ise4nJJG/nxd5kRf5hXwA1cwjNgifij0AAAAASUVORK5CYII=\n " ,
188
+ "text/plain" : " <IPython.core.display.Image object>"
189
+ },
190
+ "metadata" : {},
191
+ "execution_count" : 22
192
+ }
193
+ ],
194
+ "source" : [
195
+ " Image('qrcode.png')"
196
+ ]
197
+ },
198
+ {
199
+ "cell_type" : " code" ,
200
+ "execution_count" : 23 ,
201
+ "metadata" : {},
202
+ "outputs" : [
203
+ {
204
+ "output_type" : " execute_result" ,
205
+ "data" : {
206
+ "text/plain" : " <IPython.core.display.SVG object>" ,
207
+ "image/svg+xml": "<svg class=\"pyqrcode\" height=\"360\" width=\"360\" xmlns=\"http://www.w3.org/2000/svg\"><path class=\"pyqrline\" d=\"M4 4.5h7m1 0h2m1 0h1m1 0h8m2 0h1m1 0h4m1 0h7m-37 1h1m5 0h1m6 0h3m5 0h1m1 0h3m1 0h2m1 0h1m5 0h1m-37 1h1m1 0h3m1 0h1m2 0h2m2 0h1m4 0h2m1 0h2m3 0h1m3 0h1m1 0h3m1 0h1m-37 1h1m1 0h3m1 0h1m1 0h7m3 0h1m2 0h3m3 0h1m2 0h1m1 0h3m1 0h1m-37 1h1m1 0h3m1 0h1m2 0h1m1 0h1m4 0h2m2 0h1m2 0h2m2 0h2m1 0h1m1 0h3m1 0h1m-37 1h1m5 0h1m2 0h1m2 0h1m2 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 0h3m2 0h1m3 0h1m1 0h1m1 0h2m2 0h1m-33 1h2m2 0h3m1 0h1m2 0h3m1 0h3m2 0h3m3 0h1m-29 1h1m3 0h1m4 0h4m1 0h4m1 0h1m1 0h3m1 0h5m1 0h1m1 0h2m-35 1h3m2 0h3m1 0h4m1 0h1m1 0h1m1 0h1m2 0h1m1 0h1m1 0h2m4 0h1m1 0h2m-37 1h1m1 0h2m2 0h1m3 0h1m1 0h2m2 0h1m2 0h3m2 0h2m4 0h4m1 0h2m-36 1h2m2 0h1m1 0h1m1 0h1m1 0h1m2 0h3m2 0h4m2 0h2m1 0h1m1 0h3m3 0h1m-37 1h1m3 0h1m1 0h3m1 0h1m1 0h4m1 0h1m4 0h1m1 0h2m1 0h6m2 0h1m-28 1h2m2 0h2m4 0h2m1 0h2m2 0h4m3 0h1m3 0h1m-37 1h7m7 0h1m2 0h3m1 0h1m3 0h4m1 0h1m1 0h1m1 0h3m-37 1h1m5 0h1m1 0h1m2 0h1m1 0h1m2 0h3m1 0h7m1 0h1m3 0h1m3 0h1m-37 1h1m1 0h3m1 0h1m1 0h2m1 0h1m2 0h2m1 0h1m1 0h3m1 0h1m1 0h1m2 0h6m1 0h2m-37 1h1m1 0h3m1 0h1m2 0h1m1 0h5m1 0h3m1 0h1m2 0h2m1 0h3m1 0h2m2 0h2m-37 1h1m1 0h3m1 0h1m1 0h3m3 0h1m4 0h2m1 0h1m3 0h1m1 0h2m1 0h3m2 0h1m-37 1h1m5 0h1m3 0h1m1 0h1m1 0h1m5 0h4m1 0h4m3 0h1m2 0h1m-36 1h7m3 0h3m3 0h3m1 0h2m3 0h5m2 0h1m2 0h2\" stroke=\"#000\" transform=\"scale(8)\"/></svg>"
208
+ },
209
+ "metadata" : {},
210
+ "execution_count" : 23
211
+ }
212
+ ],
213
+ "source" : [
214
+ " from IPython.display import SVG\n " ,
215
+ " SVG('qrcode.svg')"
216
+ ]
217
+ }
218
+ ],
219
+ "metadata" : {
220
+ "language_info" : {
221
+ "codemirror_mode" : {
222
+ "name" : " ipython" ,
223
+ "version" : 3
224
+ },
225
+ "file_extension" : " .py" ,
226
+ "mimetype" : " text/x-python" ,
227
+ "name" : " python" ,
228
+ "nbconvert_exporter" : " python" ,
229
+ "pygments_lexer" : " ipython3" ,
230
+ "version" : " 3.7.4-final"
231
+ },
232
+ "orig_nbformat" : 2 ,
233
+ "kernelspec" : {
234
+ "name" : " python37464bitlearningcondacf134821621f44b6a2588003cb8c2979" ,
235
+ "display_name" : " Python 3.7.4 64-bit ('Learning': conda)"
236
+ }
237
+ },
238
+ "nbformat" : 4 ,
239
+ "nbformat_minor" : 2
240
+ }
0 commit comments