{"library":"qrcode","code":"import qrcode\nimport os\n\n# Data to encode\ndata = \"https://checklist.day/\"\n\n# --- Simple QR code generation (shortcut) ---\nimg_simple = qrcode.make(data)\nimg_simple.save(\"simple_qrcode.png\")\nprint(\"Simple QR code saved as simple_qrcode.png\")\n\n# --- Advanced QR code generation (QRCode class for more control) ---\nqr = qrcode.QRCode(\n    version=1, # Controls the size (1-40), None for automatic (fits data)\n    error_correction=qrcode.constants.ERROR_CORRECT_L, # Error correction level (L, M, Q, H)\n    box_size=10, # Number of pixels per 'box' or module\n    border=4, # Number of boxes thick the border should be (minimum 4)\n)\nqr.add_data(data)\nqr.make(fit=True) # Ensures the entire data fits into the QR code\n\nimg_advanced = qr.make_image(fill_color=\"black\", back_color=\"white\")\nimg_advanced.save(\"advanced_qrcode.png\")\nprint(\"Advanced QR code saved as advanced_qrcode.png\")\n\n# To display in a notebook (requires Pillow and an interactive environment)\n# img_advanced.show()","lang":"python","description":"This quickstart demonstrates two common ways to generate QR codes: using the convenient `qrcode.make()` shortcut for basic needs, and utilizing the `qrcode.QRCode` class for fine-grained control over parameters like version, error correction, box size, and border. Both examples save the generated QR code as a PNG image, which requires the `Pillow` library to be installed.","tag":null,"tag_description":null,"last_tested":"2026-04-24","results":[{"runtime":"python:3.10-alpine","exit_code":1},{"runtime":"python:3.10-slim","exit_code":1},{"runtime":"python:3.11-alpine","exit_code":1},{"runtime":"python:3.11-slim","exit_code":1},{"runtime":"python:3.12-alpine","exit_code":1},{"runtime":"python:3.12-slim","exit_code":1},{"runtime":"python:3.13-alpine","exit_code":1},{"runtime":"python:3.13-slim","exit_code":1},{"runtime":"python:3.9-alpine","exit_code":1},{"runtime":"python:3.9-slim","exit_code":1}]}