You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
602 B
20 lines
602 B
#pip install qrcode[pil]
|
|
import qrcode
|
|
|
|
def vytvor_qr(text,nazev_souboru):
|
|
#vytovření instance QR kódu
|
|
qr = qrcode.QRCode(version=1,box_size=10,border=5)
|
|
qr.add_data(text)
|
|
qr.make(fit=True)
|
|
img= qr.make_image(fill_color="black",back_color="white")
|
|
img.save(nazev_souboru)
|
|
print(f"QR kod byl vytvořen a uložen jako {nazev_souboru}")
|
|
|
|
print("--- GETERATOR QR KODU ---")
|
|
print("zadej text nebo webovou adresu (např. https://google.com)")
|
|
data = input("Tvůj text/odkaz: ")
|
|
soubor = "muj_qr_kod.png"
|
|
if data:
|
|
vytvor_qr(data,soubor)
|
|
else:
|
|
print("Nezadal jsi data!")
|