def runscan(self):
p = os.popen('LD_PRELOAD=/usr/libv4l/v4l1compat.so zbarcam
/dev/video0','r')
while True :
code = p.readline().split(':')[1]
print 'Got barcode:', code
def input(self):
self.entryc.insert(END, code)
这个怎么样?我想使用本地“代码”到下一个功能,以将条形码的结果插入到我的Tkinter entryBox中。
只需将其作为参数传递即可。更改input
to的定义,def input(self, code)
然后将其更改为runscan
call的最后一行input(code)
。附带说明,您不应使用“ input”作为函数名称,因为它会遮盖内置input
函数,该函数用于从控制台获取用户输入。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句