LoginSignup
1
0

PythonでQRコードを作成する

Last updated at Posted at 2024-01-09

PythonでQRコードを作成する手順及びサンプルコードです。

ライブラリインストール

pip install PyQRCode
pip install pypng

QRコード作成

import pyqrcode

def main_logic():
    target_text = 'https://docs.saurus12.com/python/qrcode'
    output_png_file = 'c:/tmp/test.png'

    code = pyqrcode.create(target_text, error='L', version=3, mode='binary')
    code.png(output_png_file, scale=5, module_color=[0, 0, 0, 128], background=[255, 255, 255])

main_logic()

本記事へのリンク

test.png

https://docs.saurus12.com/python/qrcode

👇参考URL

【簡単】QRコードの作成と読み取り in Python

[keywords]
Python QRコード

PythonでQRコードを作成する

更新日:2024/01/09

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0