Skip to content

Commit 64c129d

Browse files
author
胡耀淇
committed
add the basicdata and class WordsLevel
1 parent e48d5db commit 64c129d

File tree

5 files changed

+110
-0
lines changed

5 files changed

+110
-0
lines changed

.vscode/launch.json

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{
2+
// 使用 IntelliSense 了解相关属性。
3+
// 悬停以查看现有属性的描述。
4+
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "Python: Current File (Integrated Terminal)",
9+
"type": "python",
10+
"request": "launch",
11+
"program": "${file}",
12+
"console": "integratedTerminal"
13+
},
14+
{
15+
"name": "Python: Attach",
16+
"type": "python",
17+
"request": "attach",
18+
"port": 5678,
19+
"host": "localhost"
20+
},
21+
{
22+
"name": "Python: Module",
23+
"type": "python",
24+
"request": "launch",
25+
"module": "enter-your-module-name-here",
26+
"console": "integratedTerminal"
27+
},
28+
{
29+
"name": "Python: Django",
30+
"type": "python",
31+
"request": "launch",
32+
"program": "${workspaceFolder}/manage.py",
33+
"console": "integratedTerminal",
34+
"args": [
35+
"runserver",
36+
"--noreload",
37+
"--nothreading"
38+
],
39+
"django": true
40+
},
41+
{
42+
"name": "Python: Flask",
43+
"type": "python",
44+
"request": "launch",
45+
"module": "flask",
46+
"env": {
47+
"FLASK_APP": "app.py"
48+
},
49+
"args": [
50+
"run",
51+
"--no-debugger",
52+
"--no-reload"
53+
],
54+
"jinja": true
55+
},
56+
{
57+
"name": "Python: Current File (External Terminal)",
58+
"type": "python",
59+
"request": "launch",
60+
"program": "${file}",
61+
"console": "externalTerminal"
62+
}
63+
]
64+
}

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"python.pythonPath": "/usr/local/bin/python3"
3+
}

basic.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import xlwings as xw
2+
import pickle
3+
import os
4+
wb=xw.Book(r'高中英语单词检索词汇总表(人教版)(必修1至选修8).xlsm')
5+
sht=wb.sheets['Sheet1']
6+
sht2=wb.sheets['Sheet2']
7+
class WordsLevel(object):
8+
wordnum=0
9+
days=0
10+
data=sht2.range((1,1),(3000,3)).value
11+
def Bookselect(self):
12+
#wb=xw.Book(r'高中英语单词检索词汇总表(人教版)(必修1至选修8).xlsm')
13+
#sht=wb.sheets['Sheet1']
14+
#sht2=wb.sheets['Sheet2']
15+
print('可供选择的书籍有:')
16+
print(sht.range((1,6),(8,6)).value)
17+
bookname=input('请输入你要背诵的单词书,中间以空格作为分割。(例如:必修1 必修2)').split(' ')
18+
print(bookname)
19+
def setplan(self):
20+
while WordsLevel.data[WordsLevel.wordnum]!=[None,None,None]:
21+
WordsLevel.wordnum+=1
22+
#print(WordsLevel.wordnum)
23+
WordsLevel.days=input('大侠选择的单词共有%d,准备几天结果掉它们?' % WordsLevel.wordnum)
24+
def Saveschedule(self,duixiang):
25+
file= open('parameter.pickle','wb')
26+
pickle.dump(a,file)
27+
file.close()
28+
def Readschedule(self):
29+
with open('parameter.pickle', 'rb') as file:
30+
a=pickle.load(file)
31+
return a
32+
hasschedule=0
33+
a=WordsLevel()
34+
for filename in os.listdir("."):
35+
if filename[-6:]=='pickle':
36+
hasschedule=1
37+
break
38+
if hasschedule == 0:
39+
a.setplan()
40+
a.Saveschedule(a)
41+
else:
42+
a=a.Readschedule()
43+
print(a.days)

parameter.pickle

30 Bytes
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)