qr bugs

My code has been giving me some errors :

data is forward5
libv4l2: error setting pixformat: Device or resource busy
libv4l2: error setting pixformat: Device or resource busy
WARNING: no compatible input to output format
...trying again with output disabled
libv4l2: error setting pixformat: Device or resource busy
libv4l2: error setting pixformat: Device or resource busy
Traceback (most recent call last):
  File "qrturtle1.py", line 64, in <module>
    data = QRCode().get_data()
  File "qrturtle1.py", line 50, in __init__
    self.proc.init("/dev/video0")
zbar.UnsupportedError: ERROR: zbar processor in zbar_processor_init():
    unsupported request: no compatible image format
 
------------------
(program exited with code: 1)
Press return to continue

So I tried using google and didn’t really find a site that gave answers to this,  so I tried to search for different code examples.

https://github.com/herbyme/zbar/blob/master/python/examples/read_one.py

seems to provide some sort of solution to the problem. I have now modded the code a little at the end to read

# extract results
for symbol in proc.results:
    # do something useful with results
    print 'decoded', symbol.type, 'symbol', '"%s"' % symbol.data
print  symbol.data
if (symbol.data == "forward5"):
	print "forward 5 pixels"

which works fine

I have now integrated the turtle code in to the appropriate parts of the code

import turtle
import time
 
t = turtle.Pen()

and near the end

# extract results
for symbol in proc.results:
    # do something useful with results
    print 'decoded', symbol.type, 'symbol', '"%s"' % symbol.data
print  symbol.data
if (symbol.data == "forward5"):
	print "forward 5 pixels"
	time.sleep(1)
	turtle.forward(25)
	time.sleep(2)

This now works, I still need to create a qr code that says forward 25 as that is the one way you can see something happening properly, 5 pixels is too short a distance to make sure this works properly