From Feng-cong Li, 6 Months ago, written in Python.
Embed
  1. # -*- coding: utf-8 -*-
  2. """
  3. Created on Tue Feb 27 07:59:38 2018
  4.  
  5. @author: Feng-cong Li
  6. """
  7.  
  8. # Only tested on Windows.
  9. #
  10. # On Windows:
  11. # If the name of this script is url2barcode.py, please create a .bat file with
  12. # the following content and put the .bat file and this script in the same
  13. # directory.
  14. #
  15. # %~dp0\url2barcode.py
  16.  
  17. from os import environ
  18. from tkinter import Tk, Label
  19. from PIL import ImageTk
  20. from qrcode import make
  21.  
  22.  
  23.  
  24. if __name__ == '__main__':    
  25.     root = Tk()
  26.     url = environ['QUTE_URL'].encode('utf-8')
  27.     image = ImageTk.PhotoImage(make(url))
  28.     Label(root, image=image).pack()
  29.     root.mainloop()
  30.