Last active
October 9, 2023 21:40
-
-
Save nvk/1b45aea3e63201c65c5aed14304dd366 to your computer and use it in GitHub Desktop.
QR codes on terminal for passing things to phone…
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
#!/usr/bin/env python3 | |
import sys, pyqrcode | |
p = ' '.join(sys.argv[1:]) | |
if not p: | |
p = sys.stdin.read().strip() | |
if not p: | |
print(f"Usage: {sys.argv[0]} data-for-qr or echo 'data-for-qr' | {sys.argv[0]}") | |
sys.exit(1) | |
q = pyqrcode.create(p) | |
print(q.terminal()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment