__init__.py 630 B

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