Skip to content

Commit b5298de

Browse files
v1.3.9.3
Learn Python and use PyMe! ====The final version before the 2024 Spring Festival===== 1. Customize the title bar. 2. Switch between the run and end buttons. 3. The form is not fully displayed. 4. The template case cannot run. 5. Align and display reference points 6. Change the radius of the window fillet from setting the radius to calling the WIN11 fillet window feature
1 parent e25c773 commit b5298de

29 files changed

+95
-0
lines changed

PyMe/Ico/DHT.png

1.9 KB
Loading

PyMe/Ico/USB.png

2.4 KB
Loading

PyMe/Ico/stop.png

2.09 KB
Loading

PyMe/Market_com/Express.py

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import urllib.request
2+
import json
3+
import msvcrt
4+
import tkinter
5+
6+
7+
class Express:
8+
def __init__(self):
9+
self.Company_Dict = {1:'shentong',2:'youzhengguonei',3:'yuantong',4:'shunfeng',5:'yunda',6:'zhongtong',7:"tiantian",8:"debang"}
10+
self.CompanyID = 4
11+
self.ExpressNumber = '0000001'
12+
self.ComboBox = None
13+
#设置CompanyID
14+
def set_CompanyID(self,companyID):
15+
self.CompanyID = companyID
16+
#获取CompanyID
17+
def get_CompanyID(self):
18+
return self.CompanyID
19+
#设置ExpressNumber
20+
def set_ExpressNumber(self,expressNumber):
21+
self.ExpressNumber = expressNumber
22+
#获取ExpressNumber
23+
def get_ExpressNumber(self):
24+
return self.ExpressNumber
25+
#设置ComboBox
26+
def set_ComboBox(self,comboBox):
27+
self.ComboBox = comboBox
28+
self.ComboBox['values'] = ['申通快递','EMS邮政','圆通快递','顺丰快递','韵达快递','中通快递','天天快递','德邦快递']
29+
self.ComboBox.current(4)
30+
#获取ComboBox
31+
def get_ComboBox(self,comboBox):
32+
return self.ComboBox
33+
#查询
34+
def Query(self,ListBox):
35+
ListBox.delete(0,tkinter.END)
36+
url = "http://www.kuaidi100.com/query?type=%s&postid=%s" % (self.Company_Dict[int(self.CompanyID)], self.ExpressNumber)
37+
response = urllib.request.urlopen(url)
38+
html = response.read().decode('utf-8')
39+
target = json.loads(html)
40+
#print(target)
41+
status = target['status']
42+
if status == '200':
43+
data = target['data']
44+
#print(data)
45+
data_len = len(data)
46+
47+
for i in range(data_len):
48+
time_text = "时间: " + data[i]['time']
49+
ListBox.insert(tkinter.END,time_text)
50+
state_text = "状态: " + data[i]['context']
51+
ListBox.insert(tkinter.END,state_text)
52+
else:
53+
ListBox.insert(tkinter.END,"查询出现错误")

PyMe/Market_com/Stock.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import os
2+
import time
3+
import tushare as ts
4+
import pandas as pd
5+
import threading
6+
7+
threadactive = True
8+
9+
def Thread_GetStock(param_array):
10+
global threadactive
11+
threadactive = True
12+
while threadactive == True:
13+
for stock_code in param_array:
14+
df = ts.get_realtime_quotes(stock_code[0])
15+
e = df[['code','name','price','time']]
16+
p = df[u'price']
17+
print(e)
18+
if float(p[0]) > float(stock_code[2]) :
19+
stock_code[3].configure(text = "超过上限")
20+
elif float(p[0]) < float(stock_code[1]):
21+
stock_code[3].configure(text = "低于上限")
22+
else:
23+
stock_code[3].configure(text = "监控中")
24+
time.sleep(1)
25+
26+
class StockMonitor:
27+
def __init__(self):
28+
self.StockArray = []
29+
self.run_thread = None
30+
31+
def addStock(self,code,low,high,label):
32+
self.StockArray.append([code,low,high,label])
33+
34+
def Start(self):
35+
global threadactive
36+
threadactive = True
37+
self.run_thread = threading.Thread(target=Thread_GetStock, args=[self.StockArray])
38+
self.run_thread.start()
39+
40+
def Stop(self):
41+
global threadactive
42+
threadactive = False

PyMe/PyMe.exe

86.7 KB
Binary file not shown.
0 Bytes
Binary file not shown.
12 KB
Binary file not shown.
18.5 KB
Binary file not shown.
17.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)