提交基础数据文件
This commit is contained in:
120
scripts/showtable.ui
Normal file
120
scripts/showtable.ui
Normal file
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MainWindow</class>
|
||||
<widget class="QMainWindow" name="MainWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>600</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>MainWindow</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>320</x>
|
||||
<y>180</y>
|
||||
<width>75</width>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>PushButton</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QCheckBox" name="checkBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>230</x>
|
||||
<y>110</y>
|
||||
<width>71</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>CheckBox</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QTreeView" name="treeView">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>70</x>
|
||||
<y>250</y>
|
||||
<width>461</width>
|
||||
<height>271</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QTextEdit" name="textEdit">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>90</x>
|
||||
<y>30</y>
|
||||
<width>131</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>190</x>
|
||||
<y>180</y>
|
||||
<width>75</width>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>PushButton</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QComboBox" name="comboBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>600</x>
|
||||
<y>190</y>
|
||||
<width>81</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="editable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="modelColumn">
|
||||
<number>5</number>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>90</x>
|
||||
<y>90</y>
|
||||
<width>54</width>
|
||||
<height>12</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menubar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusbar"/>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
6
scripts/showtime.py
Normal file
6
scripts/showtime.py
Normal file
@@ -0,0 +1,6 @@
|
||||
import datetime
|
||||
|
||||
timestamp = 188576635800 # 因为这是毫秒,所以需要乘以1000
|
||||
date_time = datetime.datetime.utcfromtimestamp(timestamp / 1000) # 转换为秒
|
||||
print(f'输入时间:{timestamp} -输出时间')
|
||||
print(date_time.strftime('%Y-%m-%d %H:%M:%S'))
|
||||
50
scripts/testui.py
Normal file
50
scripts/testui.py
Normal file
@@ -0,0 +1,50 @@
|
||||
import tkinter as tk
|
||||
from tkinter import ttk
|
||||
|
||||
# 创建主窗口
|
||||
root = tk.Tk()
|
||||
root.title("倒计时示例")
|
||||
|
||||
# 设置窗口的初始尺寸
|
||||
root.geometry("400x300") # 设置为 400x300 像素
|
||||
|
||||
# 设置窗口的最小尺寸
|
||||
root.minsize(300, 200) # 最小尺寸为 300x200 像素
|
||||
|
||||
# 设置窗口的最大尺寸
|
||||
root.maxsize(500, 400) # 最大尺寸为 500x400 像素
|
||||
|
||||
# 创建一个 Frame
|
||||
frame = ttk.Frame(root)
|
||||
frame.pack(padx=10, pady=10)
|
||||
|
||||
# 创建一个 Label 用于显示倒计时
|
||||
countdown_label = ttk.Label(frame, text="倒计时:10")
|
||||
countdown_label.grid(row=0, column=0, pady=10)
|
||||
|
||||
# 定义一个倒计时函数
|
||||
def countdown():
|
||||
global count
|
||||
if count > 0:
|
||||
countdown_label.config(text=f"倒计时:{count}")
|
||||
print(f"倒计时:{count}")
|
||||
count -= 1
|
||||
root.after(1000, countdown) # 每隔1秒更新一次
|
||||
else:
|
||||
countdown_label.config(text="倒计时结束")
|
||||
|
||||
# 初始化倒计时变量
|
||||
count = 10
|
||||
|
||||
# 定义一个函数,用于启动倒计时
|
||||
def start_countdown():
|
||||
global count
|
||||
count = 10 # 重置倒计时
|
||||
countdown()
|
||||
|
||||
# 创建按钮,并绑定点击事件
|
||||
start_button = ttk.Button(frame, text="开始倒计时", command=start_countdown)
|
||||
start_button.grid(row=1, column=0, pady=5)
|
||||
|
||||
# 启动主事件循环
|
||||
root.mainloop()
|
||||
Reference in New Issue
Block a user