forked from Py-Contributors/awesomeScripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
QRCodeConverter (Py-Contributors#193)
* Added code and files for QRCodeConverter. * Edited Script.py to pass flake8 standards. * Changed folder name to lowercase.
- Loading branch information
1 parent
49aafcc
commit bfe5d5e
Showing
6 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# URL to QR Code Scanner | ||
|
||
This is a simple Python script aimed at converting long or short website URLs into QR codes to be scanned. | ||
|
||
## Requirements | ||
|
||
It is enough to run `pip install -r requirements.txt` to install all the requirements necessary for this script. | ||
|
||
## Usage | ||
|
||
Simply run `python Script.py` in your terminal and enter the URL to be converted into a QR code. | ||
|
||
## Screenshots and sample QR codes | ||
|
||
![Screenshot](Screenshot.png) | ||
|
||
QR code for [GitHub](https://www.github.com): | ||
![QR Code](QRCode-2.png) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import pyqrcode | ||
# import png | ||
# from pyqrcode import QRCode | ||
|
||
|
||
def QRCodeConverter(url, count): | ||
qr = pyqrcode.create(url) # Generating the QR code | ||
# Saving the QR code as a PNG | ||
qr.png(f'./QRCodeConverter/QRCode-{count}.png', scale=6) | ||
print("QR Code saved!") | ||
|
||
|
||
choice = 'y' | ||
count = 0 | ||
while(choice == 'y' or choice == 'yes'): | ||
count = count + 1 | ||
url = input("Enter the URL to convert into a QR Code: ") | ||
QRCodeConverter(url, count) | ||
print('Do you want to convert another URL?') | ||
choice = input('(y/yes for yes, any other key for no): ') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
PyQRCode==1.2.1 | ||
pypng==0.0.20 |