0

I just wrote the barcode generator code. The work of the program is to generate the code. I am taking data through the XML file then I will generate the barcode. Everything is working fine in .py file but when I convert the .py file to .exe file then it will not generate the barcode then shows OSError: cannot open resources. My code is

from barcode.writer import ImageWriter
import xml.dom.minidom

DOMTree = xml.dom.minidom.parse('codedata.xml')
ENVELOPE = DOMTree.documentElement
QRCODE = ENVELOPE.getElementsByTagName("QRCODE")[0]
INVOICE = QRCODE.getElementsByTagName('INVOICE')[0]
dataget=INVOICE.childNodes[0].data
with open('barcode_image.jpeg', 'wb') as f:
    barcode.Code128(str(dataget),writer=ImageWriter()).write(f) # error shows in this line

Error Image (output Image)

I don't know what to do please help me.

Ajeet Jain
  • 47
  • 7

0 Answers0