In this tutorial I will show you how to generate barcode using python. If you're not installed python-barcode module you will get the following error.
Import barcode could not be resolved Pylance - Python Error
So need to install python-barcode library.
Python Module:
pip install python-barcode
CODE:
from barcode import ISBN13 from barcode.writer import ImageWriter from PIL import Image num = "978217629618" # saving image as png bar_code = ISBN13(num, writer=ImageWriter()) # save image bar_code.save("bar_code") img = Image.open("bar_code.png") img.show()
OUTPUT:

Post your comments / questions
Recent Article
- Fix-Gradient effect turning to gray in after effects
- How to blur an image in python?
- ModuleNotFoundError: No module named 'whois' in Python GoviralHost Without Terminal
- How to Convert Image to Pencil Sketch in Python?
- AttributeError: module 'urllib' has no attribute 'request' - Python
- How to Extract audio from video files using python?
- PermissionError: [Errno 13] Permission denied: 'shampoo_sales.csv' - Python
- [WinError 145] The directory is not empty: 'FolderPath' - Python
Related Article