mirror of
https://github.com/TriM-Organization/Musicreater.git
synced 2024-11-14 11:27:42 +08:00
修正库导入BUG
This commit is contained in:
parent
887452184b
commit
9517c49ec5
3
.gitignore
vendored
3
.gitignore
vendored
@ -140,3 +140,6 @@ dmypy.json
|
|||||||
|
|
||||||
# Cython debug symbols
|
# Cython debug symbols
|
||||||
cython_debug/
|
cython_debug/
|
||||||
|
|
||||||
|
# Pycharm
|
||||||
|
/.idea
|
||||||
|
@ -58,6 +58,8 @@
|
|||||||
>
|
>
|
||||||
> `pip install brotli`
|
> `pip install brotli`
|
||||||
>
|
>
|
||||||
|
> `pip install openpyxl`
|
||||||
|
>
|
||||||
> 3. 开始使用!
|
> 3. 开始使用!
|
||||||
> 在目录下打开cmd,进入到目录下,执行以下命令:(选择你需要的)
|
> 在目录下打开cmd,进入到目录下,执行以下命令:(选择你需要的)
|
||||||
>
|
>
|
||||||
|
@ -66,6 +66,8 @@ A simple Python package.
|
|||||||
>
|
>
|
||||||
> `pip install brotli`
|
> `pip install brotli`
|
||||||
>
|
>
|
||||||
|
> `pip install openpyxl`
|
||||||
|
>
|
||||||
> 3. Start using!
|
> 3. Start using!
|
||||||
>
|
>
|
||||||
> Open CMD in the directory, enter the directory, and execute the following commands:
|
> Open CMD in the directory, enter the directory, and execute the following commands:
|
||||||
|
@ -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",
|
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",
|
"8": "share", "9": "harp", "10": "didgeridoo", "11": "harp", "12": "xylophone", "13": "chime", "14": "harp",
|
||||||
|
28
msctPkgver/readXLSX.py
Normal file
28
msctPkgver/readXLSX.py
Normal 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)
|
Loading…
Reference in New Issue
Block a user