我刚刚编写了一个简单的代码,以使用Symbol(WindowCE)scanner轻松完成一些工作,但是python在扫描仪中无法正常工作,因此现在我必须将python代码转换为vb2008。我是编程新手。(对不起,我的英语)
数据文件名INC_MF.csv INCBOX001,ABC PLAZA -INC,1036 INCBOX002,ABC PLAZA -INC,298 INCBOX003,ABC PLAZA -INC,7096
Python代码:
# Check Box for which Store from container stcok
import csv
close1 = "x.csv","X.csv"
close = "p","P"
filext=".csv"
while True:
loadfile = input('Please Enter the File name to Load the File....
\"x = Close\"\n') + filext
if loadfile in ('')+filext:
print("Please Write the File name and file should be 'CSV'
formate.")
continue
elif loadfile in (close1):
exit()
elif loadfile == [1]:
next()
while True:
print("\n>>>> "+loadfile+" <<<<")
number = input('Please scan barcode... \"P = Previous "Load
File" \"\n')
if number in (''):
continue
if number in (close):
break
reader = csv.reader(open(loadfile,'r'))
header = next(csv.reader(open(loadfile)))
print(',\t'.join(header))
for row in reader:
if number == row[0]:
print (",\t".join(row))
谢谢。