import xlrd
import sys,time

data  = xlrd.open_workbook("C:\Users\Administrator\Desktop\\new1.xlsx")

table = data.sheets()[0]

cols = table.ncols
rows = table.nrows

for i in range(cols):
    fields = table.col_values(i)
    [appname,packet] = fields[:2] 
    # print appname,packet
    for word in fields[2:]:
        sys.stdout.flush()
        # print "1:"+repr(word),
        if len(word.strip())>0:
            #print packet+"|"+word#有时候丟数据
            print packet,"|",word#正常
            time.sleep(0.01)
            sys.stdout.flush()

 

相关文章:

  • 2022-01-02
  • 2021-10-21
  • 2022-12-23
  • 2022-12-23
  • 2021-08-22
  • 2022-12-23
  • 2021-07-12
猜你喜欢
  • 2022-02-10
  • 2022-12-23
  • 2022-12-23
  • 2021-05-29
  • 2021-06-20
  • 2022-01-01
相关资源
相似解决方案