velog QRcode 생성하기

단단한어린이·2023년 10월 31일
0

Python

목록 보기
6/6
import qrcode

# URL
url = 'https://velog.io/@binest03459'

# QR code 생성
qr = qrcode.QRCode(
    version=1,
    error_correction=qrcode.constants.ERROR_CORRECT_H,
    box_size=10,
    border=4,
)
qr.add_data(url)
qr.make(fit=True)

# 이미지로 저장
img = qr.make_image(fill_color="lightgreen", back_color="black").resize((1024, 1024))
img.save('qrcode.png')

profile
Footprints in Coding

0개의 댓글