【发布时间】:2010-12-23 02:25:39
【问题描述】:
我正在使用 zbarcam 从我的网络应用程序中的网络摄像头读取条形码。 但是,由于 zbarcam 在最后显示一个 \n,我的表单是提交。
这是我使用的:
read_one.py
#!/usr/bin/python
from sys import argv
import zbar
import webbrowser
# create a Processor
proc = zbar.Processor()
# configure the Processor
proc.parse_config('enable')
# initialize the Processor
device = '/dev/video0'
if len(argv) > 1:
device = argv[1]
proc.init(device)
# enable the preview window
proc.visible = True
# read at least one barcode (or until window closed)
proc.process_one()
# hide the preview window
proc.visible = False
# extract results
for symbol in proc.results:
# do something useful with results
print symbol.data
keyboard.sh
python read_one.py | xvkbd -file -
如何在将条形码发送到 xvkbd 之前删除“\n”或禁用 xvkbd 中的回车键?
【问题讨论】:
标签: python bash barcode barcode-scanner