Spaces:
Sleeping
Sleeping
mojoee
commited on
Commit
·
dcb21f9
1
Parent(s):
a4bc462
added qrcode generator
Browse files- .gitignore +43 -0
- app.py +18 -0
- qrcode.png +0 -0
- src/qrcodeGenerator.py +11 -0
.gitignore
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Python
|
2 |
+
*.pyc
|
3 |
+
__pycache__/
|
4 |
+
*.pyo
|
5 |
+
*.pyd
|
6 |
+
*.pyi
|
7 |
+
*.pyz
|
8 |
+
*.pyw
|
9 |
+
*.pyz/
|
10 |
+
*.pyw/
|
11 |
+
*.egg-info/
|
12 |
+
dist/
|
13 |
+
build/
|
14 |
+
*.egg
|
15 |
+
*.whl
|
16 |
+
|
17 |
+
# Jupyter Notebook
|
18 |
+
.ipynb_checkpoints/
|
19 |
+
|
20 |
+
# Data
|
21 |
+
data/
|
22 |
+
*.csv
|
23 |
+
*.json
|
24 |
+
*.xlsx
|
25 |
+
|
26 |
+
# Model artifacts
|
27 |
+
models/
|
28 |
+
|
29 |
+
# Virtual environment
|
30 |
+
venv/
|
31 |
+
env/
|
32 |
+
.venv/
|
33 |
+
.venv/
|
34 |
+
|
35 |
+
# IDE
|
36 |
+
.vscode/
|
37 |
+
.idea/
|
38 |
+
|
39 |
+
# Logs
|
40 |
+
*.log
|
41 |
+
|
42 |
+
# Miscellaneous
|
43 |
+
.DS_Store
|
app.py
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from src import qrcodeGenerator
|
2 |
+
import gradio as gr
|
3 |
+
|
4 |
+
|
5 |
+
def greet(name, intensity):
|
6 |
+
return "Hello, " + name + "!" * int(intensity)
|
7 |
+
|
8 |
+
|
9 |
+
if __name__ == "__main__":
|
10 |
+
# qrcodeGenerator.generate_qrcode()
|
11 |
+
|
12 |
+
demo = gr.Interface(
|
13 |
+
fn=greet,
|
14 |
+
inputs=["text", "slider"],
|
15 |
+
outputs=["text"],
|
16 |
+
)
|
17 |
+
|
18 |
+
demo.launch(share=True)
|
qrcode.png
ADDED
![]() |
src/qrcodeGenerator.py
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import qrcode
|
2 |
+
|
3 |
+
def generate_qrcode(weblink):
|
4 |
+
qr = qrcode.QRCode(version=1, box_size=10, border=5)
|
5 |
+
qr.add_data(weblink)
|
6 |
+
qr.make(fit=True)
|
7 |
+
qr_img = qr.make_image(fill="black", back_color="white")
|
8 |
+
qr_img.save("qrcode.png")
|
9 |
+
|
10 |
+
# Example usage
|
11 |
+
generate_qrcode("https://www.google.com")
|