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.

23 lines
658 B

#pip install qrcode[pil]
import qrcode
def vytvor_qr(text,nazev_souboru):
#vyvoření instance QR kódu
qr = qrcode.QRCode(version=1,
box_size=15,border=5)
qr.add_data(text)
qr.make(fit=True)
img = qr.make_image(fill_color="red",
back_color="black")
img.save(nazev_souboru)
print(f"QR kod byl vytvoen a uložen jako \
{nazev_souboru}")
print("--- GENERATOR QR KODU ---")
print("Zadej text nebo webovou adresu (např.https://www.odbornaskola.cz)")
data = input("Tvůj text/odkaz:")
soubor = "muj_qr_kod.png"
if data:
vytvor_qr(data,soubor)
else:
print("Nezadal jsi data!")