HOW TO GENERATE QRCODE AND BARCODE USING PYTHON PROGRAMING

QRCODE:-
               To generate QRcode in python we have a library called QRcode. To use this library we have to install the QRcode package from pip.

To install QRcode from pip 
  • First of all open your command prompt
  • And enter the command as shown below  before installing it check whether your system has installed python or not
  • If you have already installed python then open the command prompt and enter as follows     
  pip install qrcode

      After installing the QRcode package now open your vscode editor to write a python code

CODE TO GENERATE QRCODE USING PYTHON:-

import qrcode as qr

img=qr.make("message")

img.save("photo.png")


 TO CHECK HOW THE CODE WORKS GO TO THE LINK BELOW:-

https://www.youtube.com/watch?v=8v4YpC_BKds


BARCODE:-
               To generate barcode in python we have a library called barcode. To use this library we have to install the barcode package from pip.

To install barcode from pip 
  • First of all open your command prompt
  • And enter the command as shown below  before installing it check whether your system has installed python or not
  • If you have already installed python then open the command prompt and enter as follows     
  pip install python-barcode

      After installing the barcode package now open your vscode editor to write a python code

CODE TO GENERATE BARCODE USING PYTHON:-

from barcode import EAN13

from barcode.writer import ImageWriter

number="123456789021"   

a=EAN13(number,writer=ImageWriter())

a.save("photo1.png")


NOTE:-

barcode stores only numbers that have a maximum range of only 12  digits


 TO CHECK HOW THE CODE WORKS GO TO THE LINK BELOW:-

Comments