Jordan
Jordan

Reputation: 181

Strange Barcode Appearance in CMD (python), explanation?

Something very weird happened. I'm experimenting with the split() method and parsing data. When I printed my results to CMD there was a random barcode among the lines. When I ran the program again, there was no barcode.

Any explanation / hypothesis?

file = open("dbuslog.txt", "r")
lines = file.readlines()


line = lines[0].split('=:')
line = ' '.join(line)
print ""
print line
line = line.split(' ->')
line = ''.join(line)

print ""
print line
line = line.split('=')
line = ' '.join(line)
print ""
print line
line = line.split(' ')
print ""
print line

dict = {}
if len(line)%2 == 0:
    index = 0
    while index < len(line)-1:
        dict[line[index]] = line[index+1]
        index += 2
else:
    print "SOMETHING IS WRONG, DID NOT PARSE CORRECTLY, ODD NUMBER OF ITEMS"
print ""
print dict

file.close()

Here is are the pictures: The bottom one is the screen shot (I edited out my username - no other changes) The upper one is our attempt to find a match. When it is flipped horizontally it meets the specifications for ITF (Interleaved 2 of 5)

Flipped and Scaled

Original

Upvotes: 0

Views: 362

Answers (1)

pconnell
pconnell

Reputation: 4781

Have a look at the glyphs which correspond to the values between 219 and 223.

http://www.asciitable.com/

Your program was probably printing an ASCII string containing those sorts of values. So it looked like a barcode when printed to your terminal window.

It's not actually a barcode.

Upvotes: 1

Related Questions