__init__.py 645 B

123456789101112131415161718192021222324252627282930
  1. from qrcode.main import QRCode
  2. from qrcode.main import make # noqa
  3. from qrcode.constants import ( # noqa
  4. ERROR_CORRECT_L,
  5. ERROR_CORRECT_M,
  6. ERROR_CORRECT_Q,
  7. ERROR_CORRECT_H,
  8. )
  9. from qrcode import image # noqa
  10. def run_example(data="http://www.lincolnloop.com", *args, **kwargs):
  11. """
  12. Build an example QR Code and display it.
  13. There's an even easier way than the code here though: just use the ``make``
  14. shortcut.
  15. """
  16. qr = QRCode(*args, **kwargs)
  17. qr.add_data(data)
  18. im = qr.make_image()
  19. im.show()
  20. if __name__ == "__main__": # pragma: no cover
  21. import sys
  22. run_example(*sys.argv[1:])