Explorar el Código

excel_util: 数据类型调整

Signed-off-by: binren <zhangbr@elab-plus.com>
binren hace 5 años
padre
commit
2c4e907b28
Se han modificado 1 ficheros con 3 adiciones y 3 borrados
  1. 3 3
      excel_util.py

+ 3 - 3
excel_util.py

@@ -204,7 +204,7 @@ class ExcelUtil:
         for row in rows:
             sub_option_value = row[12].value
             if sub_option_value != '占位':
-                key = row[1].value + str(row[9].value)
+                key = str(int(row[1].value)) + str(int(row[9].value))
                 # 数据类型,数据项名称,所在tab
                 info[key] = [row[15].value, row[13].value, row[14].value]
         return info
@@ -212,6 +212,6 @@ class ExcelUtil:
 
 if __name__ == '__main__':
     import json
-    eu = ExcelUtil(file_name=r'D:\elab\elab_mvp\resources\module.xlsx')
-    data = eu.module_behavior_info()
+    eu = ExcelUtil('工作表6', 'tongce.xlsx')
+    data = eu.read_options_info()
     print(json.dumps(data, ensure_ascii=False))