parent
a98714b8e5
commit
360aa790c3
@ -0,0 +1,65 @@
|
||||
import tkinter as tk
|
||||
import os
|
||||
from tkinter import messagebox
|
||||
import ttkbootstrap as ttk
|
||||
|
||||
#执行new_house.py
|
||||
def open_new_house():
|
||||
os.system('new_house.py')
|
||||
# 执行new_house_clean.py
|
||||
def open_new_house_clean():
|
||||
os.system('new_house_clean.py')
|
||||
# 执行new_house_visualization.py
|
||||
def open_new_house_visualization():
|
||||
os.system('new_house_visualization.py')
|
||||
messagebox.showinfo('提醒', '可视化完成!可以点击主页面下面按钮查看图像')
|
||||
def open_analyse_1():
|
||||
os.startfile(f"新房数据展示1.jpg")
|
||||
def open_analyse_2():
|
||||
os.startfile(f"新房数据展示2.jpg")
|
||||
def open_analyse_3():
|
||||
os.startfile(f"新房数据展示3.jpg")
|
||||
|
||||
# 窗口对象+美化
|
||||
window = ttk.Window()
|
||||
style = ttk.Style("minty")
|
||||
window.geometry("500x350+400+250")
|
||||
window.title("房天下长沙新房爬取")
|
||||
# 图片
|
||||
canvas = tk.Canvas(window, height=150, width=500)
|
||||
image_file = tk.PhotoImage(file=r"./IMG_0818.PNG")
|
||||
image = canvas.create_image(50,20, anchor='nw', image=image_file)
|
||||
canvas.pack(side='top')
|
||||
|
||||
# 开始爬虫
|
||||
b1=tk.Button(window)
|
||||
b1['text']="1.开始爬虫"
|
||||
b1['command']=open_new_house
|
||||
b1.place(x=110, y=150)
|
||||
# 清洗数据
|
||||
b2=tk.Button(window)
|
||||
b2['text']="2.清洗数据"
|
||||
b2['command']=open_new_house_clean
|
||||
b2.place(x=210, y=150)
|
||||
# 可视化
|
||||
b3=tk.Button(window)
|
||||
b3['text']="3.开始可视化"
|
||||
b3['command']=open_new_house_visualization
|
||||
b3.place(x=310, y=150)
|
||||
|
||||
b4=tk.Button(window)
|
||||
b4['text']="3.1查看行政区平均新房单价分析图像"
|
||||
b4['command']=open_analyse_1
|
||||
b4.place(x=130, y=190)
|
||||
|
||||
b5=tk.Button(window)
|
||||
b5['text']="3.2查看新房户型占比分析图像"
|
||||
b5['command']=open_analyse_2
|
||||
b5.place(x=130, y=230)
|
||||
|
||||
b6=tk.Button(window)
|
||||
b6['text']="3.3查看新房数量占比分析图像"
|
||||
b6['command']=open_analyse_3
|
||||
b6.place(x=130, y=270)
|
||||
# 进入消息循环
|
||||
window.mainloop()
|
Loading…
Reference in new issue