Skip to content

Commit 6cc777e

Browse files
Implement qr generator using python
1 parent 8b652a6 commit 6cc777e

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

QR Generator/README.md

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# QR Code Generator using python
2+
3+
## What is a QR code?
4+
5+
QR codes are used to encode and decode the data into a machine-readable form. The use of camera phones to read two-dimensional barcodes for various purposes is currently a popular topic in both types of research and practical applications. #
6+
7+
### Steps:
8+
9+
1. To generate QR Codes with Python you need to install only one Python library for this task:
10+
11+
> pip install pyqrcode
12+
13+
2. Now let’s see how to create a QR Code with Python programming language
14+
15+
```{python3}
16+
import pyqrcode
17+
from pyqrcode import QRCode
18+
19+
# String which represent the QR code
20+
21+
s = "https://github.com/laxmanbalaraman/"
22+
23+
# Generate QR code
24+
25+
url = pyqrcode.create(s)
26+
27+
# Create and save the png file naming "myqr.png"
28+
29+
url.svg("myQr.svg", scale = 8)
30+
```
31+
32+
3. View the Qr file that must be save in your current directory
33+
34+
![myQr](https://user-images.githubusercontent.com/67074796/193398963-a7d78e27-3839-45ca-9664-e04ed3708f40.svg)
35+
36+
**Viola you have successfully created a QR code you using python!!**

QR Generator/qr_generator.py

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import pyqrcode
2+
from pyqrcode import QRCode
3+
4+
# String which represent the QR code
5+
s = "https://github.com/laxmanbalaraman/"
6+
7+
# Generate QR code
8+
url = pyqrcode.create(s)
9+
10+
# Create and save the png file naming "myqr.png"
11+
url.svg("myQr.svg", scale = 8)

0 commit comments

Comments
 (0)