#!/usr/bin/python3.5
# -*- coding: UTF-8 -*-
import xlrd
import os
import xlwt
from xlrd import xldate_as_tuple
import datetime
'''
xlrd中单元格的数据类型
数字一律按浮点型输出,日期输出成一串小数,布尔型输出0或1,所以我们必须在程序中做判断处理转换
成我们想要的数据类型
0 empty,1 string, 2 number, 3 date, 4 boolean, 5 error
'''
def stringCompare(str1, str2):
for i in range(len(str2)):
if str1 == str2[i]:
return 1
return -1
def get_board_port(val,val_len):
a = 0
for i in range(1,val_len):
if val[i] == '/':
a = a+1
if a == 2:
if val[i+2] == '/':
board = val[i+1]
if val[i+3] == '/':
board[0] = val[i+1]
board[1] = val[i+2]
if a == 3:
port = val[i+1]
if i+3 == val_len:
port = port + val[i+2]
return board,port