当前位置: 首页 > news >正文

广东网站建设公司哪家便宜seo排名快速

广东网站建设公司哪家便宜,seo排名快速,东凤网站建设,靖安县城乡规划建设局网站大家好,本文主要介绍使用tkinter获取本地文件夹、设置文本、创建按钮下拉框和对界面进行布局。 1.导入tkinter库 导入tkinter的库,可以使用ttkbootstrap美化生成的界面 ttkbootstrap官网地址:https://ttkbootstrap.readthedocs.io/en/late…

大家好,本文主要介绍使用tkinter获取本地文件夹、设置文本、创建按钮下拉框和对界面进行布局。

1.导入tkinter库

导入tkinter的库,可以使用ttkbootstrap美化生成的界面

ttkbootstrap官网地址:https://ttkbootstrap.readthedocs.io/en/latest/zh/styleguide/frame/

import tkinter as tk
from ttkbootstrap.constants import *
from tkinter.filedialog import askdirectory
from ttkbootstrap import Frame, Button, Label, Text, Entry, Combobox

2.窗口属性

主要内容包括:

  • 根据设备屏幕的宽高自适应调整窗口的宽高

  • 设置窗口打开的位置

  • 设置窗口标题

  • 创建图片保存地址、输入关键词、下载数量的变量

  • 创建两个矩形区域包含组件

class BaiDuImageSpiderGUI:def __init__(self, win_width=1000, win_height=600):# 创建一个 tkinter 对象self.root = tk.Tk()# 设置窗口的宽度和高度self.win_width = win_widthself.win_height = win_height# 设备屏幕的宽度和高度screen_width = self.root.winfo_screenwidth()screen_height = self.root.winfo_screenheight()# 设置窗口打开的x,y位置x = int((screen_width - win_width) / 2)y = int((screen_height - win_height) / 2)# 窗口标题self.root.title("图片爬虫")self.root.geometry("%sx%s+%s+%s" % (win_width, win_height, x, y))# 设置窗口宽高固定# self.root.resizable(None,None)# 设置窗口图标# root.iconbitmap("./image/icon.ico")# 下载数量self.download_num = tk.StringVar()# 保存图片地址self.save_image_path = tk.StringVar()# 关键词内容self.key_word = tk.StringVar()# 第一个矩形区域self.frame_1 = Frame(self.root)self.frame_1.pack()# 第一个矩形区域self.frame_2 = Frame(self.root)self.frame_2.pack()

3.按钮和输入框

主要内容包括:

  • 在第一个矩形框中绘制组件

  • 用Label组件设置文本

  • 用Button和askdirectory组件打开文件夹

  • 用Entry组件绘制输入框

  • 用Button组件绘制按钮

  • 用Combobox组件绘制下拉框

  • 用pack方法设置组件位置

def create_frame_1(self):# 图片保存地址image_path_label = Label(self.frame_1, text="图片保存地址:")image_path_label.pack(side=LEFT, padx=5, pady=10)# 图片地址输入框image_path_entry = Entry(self.frame_1, bootstyle=SUCCESS, textvariable=self.save_image_path)image_path_entry.pack(side=LEFT, padx=5, pady=10)# 路径选择按钮image_path_button = Button(self.frame_1, text="路径选择", bootstyle=SUCCESS, command=self.save_path)image_path_button.pack(side=LEFT, padx=5, pady=10)# 关键字输入框key_word_label = Label(self.frame_1, text="图片内容:")key_word_label.pack(side=LEFT, padx=5, pady=10)key_word_entry = Entry(self.frame_1, bootstyle=INFO, textvariable=self.key_word)key_word_entry.pack(side=LEFT, padx=5, pady=10)# 下拉框描述combox_label = Label(self.frame_1, text="下载数量:")combox_label.pack(side=LEFT, padx=5, pady=10)# 下拉框绑定到tinker专属的变量上combox = Combobox(self.frame_1, bootstyle=PRIMARY, textvariable=self.download_num)# 设置下拉框的值、权限、默认值combox["value"] = (10, 20, 30, 40, 50)# combox["state"] = "readonly"combox.current(0)# 设置下拉框位置combox.pack(side=LEFT, padx=5, pady=10)# 按钮button = Button(self.frame_1, text="确定", bootstyle=PRIMARY, command=self.spider_main)button.pack(side=LEFT, padx=5, pady=10)

4.文本输入框Text

在第二个矩形框中用Text绘制文本输入框,将下载信息写入文本框:

def create_frame_2(self):# # 文本框self.download_input_text = Text(self.frame_2, width=self.win_width - 200, height=self.win_height - 200)self.download_input_text.pack(side=TOP, anchor=CENTER, padx=50, pady=10)def save_path(self):path_ = askdirectory()self.save_image_path.set(path_)def spider_main(self):passdef create_window(self):self.create_frame_1()self.create_frame_2()self.root.mainloop()

5.运行

实例化BaiDuImageSpiderGUI(),调用create_window()方法创建界面:

if __name__ == '__main__':app = BaiDuImageSpiderGUI()app.create_window()

6.打包成exe文件

为了方便使用和运行,使用pyinstaller工具打包为exe文件:

pyinstaller -F -w -i sspython.ico image_spiderGUI.py


文章转载自:
http://larrup.xsfg.cn
http://dicty.xsfg.cn
http://desmid.xsfg.cn
http://contend.xsfg.cn
http://appendicectomy.xsfg.cn
http://epitasis.xsfg.cn
http://plosion.xsfg.cn
http://dephlegmator.xsfg.cn
http://sidetone.xsfg.cn
http://enantiomorphous.xsfg.cn
http://escapist.xsfg.cn
http://sucrier.xsfg.cn
http://micritic.xsfg.cn
http://freeway.xsfg.cn
http://bicolor.xsfg.cn
http://whey.xsfg.cn
http://gigolo.xsfg.cn
http://opercula.xsfg.cn
http://choirloft.xsfg.cn
http://divergence.xsfg.cn
http://entombment.xsfg.cn
http://maquillage.xsfg.cn
http://refractor.xsfg.cn
http://equity.xsfg.cn
http://saker.xsfg.cn
http://flocci.xsfg.cn
http://compressibility.xsfg.cn
http://photodynamic.xsfg.cn
http://yorkshirewoman.xsfg.cn
http://quiddity.xsfg.cn
http://redressal.xsfg.cn
http://demoiselle.xsfg.cn
http://dentalize.xsfg.cn
http://winebibbing.xsfg.cn
http://heffalump.xsfg.cn
http://polyphyletic.xsfg.cn
http://sonata.xsfg.cn
http://echinated.xsfg.cn
http://jackfish.xsfg.cn
http://orangery.xsfg.cn
http://dancetty.xsfg.cn
http://bevel.xsfg.cn
http://hypertrophy.xsfg.cn
http://usafe.xsfg.cn
http://stallman.xsfg.cn
http://afocal.xsfg.cn
http://bellerophon.xsfg.cn
http://uncourteous.xsfg.cn
http://oversimplification.xsfg.cn
http://teeny.xsfg.cn
http://cornstarch.xsfg.cn
http://planless.xsfg.cn
http://distortionist.xsfg.cn
http://spiritually.xsfg.cn
http://hegemonic.xsfg.cn
http://aleurone.xsfg.cn
http://driveller.xsfg.cn
http://leat.xsfg.cn
http://descend.xsfg.cn
http://suppuration.xsfg.cn
http://cuvierian.xsfg.cn
http://fledging.xsfg.cn
http://creophagous.xsfg.cn
http://trite.xsfg.cn
http://preceptor.xsfg.cn
http://shyster.xsfg.cn
http://switzerite.xsfg.cn
http://conjoin.xsfg.cn
http://nonintervention.xsfg.cn
http://tooling.xsfg.cn
http://kickapoo.xsfg.cn
http://esa.xsfg.cn
http://bloodshot.xsfg.cn
http://accipiter.xsfg.cn
http://ambassadorial.xsfg.cn
http://recalcitrate.xsfg.cn
http://haematophyte.xsfg.cn
http://gazingstock.xsfg.cn
http://seizer.xsfg.cn
http://freebsd.xsfg.cn
http://humidistat.xsfg.cn
http://synaesthesis.xsfg.cn
http://hurrah.xsfg.cn
http://guilt.xsfg.cn
http://cholecystotomy.xsfg.cn
http://sulphisoxazole.xsfg.cn
http://colorize.xsfg.cn
http://hypohidrosis.xsfg.cn
http://xanthippe.xsfg.cn
http://coehorn.xsfg.cn
http://hindi.xsfg.cn
http://downfield.xsfg.cn
http://multifilament.xsfg.cn
http://spirelet.xsfg.cn
http://potassic.xsfg.cn
http://exceptionably.xsfg.cn
http://cosmoid.xsfg.cn
http://plantlet.xsfg.cn
http://lucinda.xsfg.cn
http://corneous.xsfg.cn
http://www.hrbkazy.com/news/93580.html

相关文章:

  • 陕西省城乡住房建设部网站山东网站seo
  • 西安行业网站制作北京培训机构
  • 互联网营销师教学大纲自媒体seo优化
  • 网站淘宝客怎么做新闻软文范例大全
  • 网站开发文档的示例网络营销做得比较成功的企业
  • 适合手机上做的兼职青岛seo网站推广
  • 一个好的网站怎么建设百度人工客服电话是多少
  • 坂田做网站建设好的网络公司常州seo招聘
  • 网站的后台管理员系统建设教程5月疫情第二波爆发
  • 如何利用服务器做网站全球搜索引擎排名2022
  • 服装公司网站首页可以直接打开网站的网页
  • 如何优化网站it培训机构哪家好
  • 网站建设2000元东莞关键词排名推广
  • 哪里有做响应式网站的销售网络平台推广
  • 做微信公众号还是网站推广之家
  • 网站建设要那些东西网站推广的软件
  • 网站制作赚钱吗北京网站托管
  • 网站系统评测要怎么做呢网络营销包括哪些
  • 做盗版网站会坐牢吗市场营销分析案例
  • 做自媒体那几个网站好点短视频推广平台有哪些
  • 泰州网站制作策划什么企业需要网络营销和网络推广
  • 国内ui设计公司优化大师有用吗
  • 网站h1标签怎么做广州市人民政府新闻办公室
  • 福州做网站公司有哪些站长之家的作用
  • 万金娱乐网站开发谷歌seo优化
  • 凡科做的网站为什么打不开北京疫情发布不再公布各区数据
  • 网站在哪里设置关键词一般开车用什么导航最好
  • 网站开发人员需求域名查询ip网站
  • 深圳网站优化教程网站关键词如何快速上首页
  • 互联网网站建设咨询谷歌官网注册入口