PythonTkinter 练习11之 自编工具 扫描地址段IP
#Time: 2020/03/05
#Author: Xiaohong
#运行环境: OS: Win7 64位 专业版Pack1
# Python: 3.7
功能:输入要扫描的地址段,检测哪些地址可以ping通
q缺点:1. 只考虑IPV4地址 2.只考虑Windows平台
Toolbox_main.py
import tkinter as tk
from Tl_baidu_scan_screen import *
from Tl_ip_scan_screen import *
class Win_Program:
def __init__(self):
self.master = tk.Tk()
self.master.state("zoomed") # 窗口最大化
self.master.title("Xiaohong's Toolbox")
self.master.grid()
self.SetupUI()
def SetupUI(self):
# 获取屏幕长/宽
Screen_width = self.master.winfo_screenwidth()
Screen_height = self.master.winfo_screenheight()
print(Screen_height,Screen_width)
fm1=tk.LabelFrame(self.master,text='爬取部分',padx=5,pady=5,width=800,height=100)
fm1.grid(row=0,column=1,padx=10,pady=10)
button1=tk.Button(fm1,text='baidu图片识别',command=lambda:self.Call_baidu_scan_win(self.master,Screen_width,Screen_height))
button1.grid(row=0,column=1,padx=5,pady=0)
fm2=tk.LabelFrame(self.master,text='其他部分',padx=5,pady=5,width=800,height=100)
fm2.grid(row=1,column=1,padx=10,pady=10)
button2=tk.Button(fm2,text='IP 地址扫描',command=lambda:self.Call_ip_scan_win(self.master,Screen_