效果图:
上代码:
import threading
import tkinter as tk # 使用Tkinter前需要先导入
import random
import re
import time
import requests
from bs4 import BeautifulSoup
# 第1步,实例化object,建立窗口window
window = tk.Tk()
# 第2步,给窗口的可视化起名字
window.title('Wellcome to wangning APP')
# 第3步,设定窗口的大小(长 * 宽)
window.geometry('500x400') # 这里的乘是小x
# 第4步,加载 wellcome image
canvas = tk.Canvas(window, width=500, height=135, bg='green')
image_file = tk.PhotoImage(file='img/pic.gif')
image = canvas.create_image(250, 0, anchor='n', image=image_file)
canvas.pack(side='top')
tk.Label(window, text='Wellcome', font=('Arial', 16)).pack()
tk.Label(window,text='URL',font=('Arial',14)).place(x=10,y=170)
tk.Label(window,text='PAGES',font=('Arial',14)).place(x=10,y=