修正库导入BUG

This commit is contained in:
bgArray 2022-06-28 07:43:15 +08:00
parent 887452184b
commit 9517c49ec5
5 changed files with 35 additions and 28 deletions

3
.gitignore vendored
View File

@ -140,3 +140,6 @@ dmypy.json
# Cython debug symbols
cython_debug/
# Pycharm
/.idea

View File

@ -58,6 +58,8 @@
>
> `pip install brotli`
>
> `pip install openpyxl`
>
> 3. 开始使用!
> 在目录下打开cmd进入到目录下执行以下命令(选择你需要的)
>

View File

@ -66,6 +66,8 @@ A simple Python package.
>
> `pip install brotli`
>
> `pip install openpyxl`
>
> 3. Start using!
>
> Open CMD in the directory, enter the directory, and execute the following commands:

View File

@ -1,31 +1,3 @@
def get():
from openpyxl import *
wb = load_workbook('program音色表.xlsx')
ws = wb.active
# 所有行
keys = []
values = []
for row in ws.iter_rows():
for cell in row:
# print(cell.value)
try:
keys.append(int(cell.value))
except ValueError:
values.append(cell.value)
# # 所有列
# for column in ws.iter_cols():
# for cell in column:
# print(cell.value)
out = ""
index = 0
for i in keys:
out += ", \"" + str(i) + "\": \"" + values[index] + "\""
index += 1
print(out)
idList = {"0": "harp", "1": "harp", "2": "pling", "3": "harp", "4": "pling", "5": "pling", "6": "harp", "7": "harp",
"8": "share", "9": "harp", "10": "didgeridoo", "11": "harp", "12": "xylophone", "13": "chime", "14": "harp",

28
msctPkgver/readXLSX.py Normal file
View File

@ -0,0 +1,28 @@
from openpyxl import *
def get():
wb = load_workbook('program音色表.xlsx')
ws = wb.active
# 所有行
keys = []
values = []
for row in ws.iter_rows():
for cell in row:
# print(cell.value)
try:
keys.append(int(cell.value))
except ValueError:
values.append(cell.value)
# # 所有列
# for column in ws.iter_cols():
# for cell in column:
# print(cell.value)
out = ""
index = 0
for i in keys:
out += ", \"" + str(i) + "\": \"" + values[index] + "\""
index += 1
print(out)