【Python】GUI界面简单呈现
【Python】GUI界面简单呈现1、Tkinter界面GUI系统化讲解 笔记Python GUI之tkinter窗口视窗教程大集合(看这篇就够了)菜鸟教程单选与多选框,也有输入框等入门内容Python Tkinter Grid布局管理器详解2、EasyGUIEasyGUI 学习文档【超详细中文版】(from小甲鱼 )# -*- coding: utf-8 -*-# 本程序主要用于文本数据打标签f
·
【Python】GUI界面简单呈现
1、Tkinter界面GUI
- 系统化讲解 笔记
- Python GUI之tkinter窗口视窗教程大集合(看这篇就够了)
- 菜鸟教程
- 单选与多选框,也有输入框等入门内容
- Python Tkinter Grid布局管理器详解
2、EasyGUI
# -*- coding: utf-8 -*-
# 本程序主要用于文本数据打标签
from easygui import *
import sys
# reload(sys)
# sys.setdefaultencoding("utf-8")
# 文件夹名,此处打码,需要个人修改
folder = r'##############'
# 标题,需要个人修改
title = "这是GUI的标题"
# 读入文件,此处打码,需要个人修改,建议txt文件
label_read = r'##############'
# 写出文件,此处打码,需要个人修改,建议txt文件
label_write = r'##############'
while 1:
with open(folder + label_read, 'r', encoding="utf-8") as read_file:
lines = read_file.readlines()
# 读取上次标注,因此可以在标注时随时中断
with open(folder + label_write, 'r',encoding="utf-8") as write_file:
position = len(write_file.readlines())
# 标注用的选项,单选,需要个人修改
boxes = ["label1", "label2", "label3"]
count = 0 # 计数
for line in lines:
count += 1
line = line.strip() # 去 \n
text=line.split("\t")[2] # 文本所在的列号不同,需要个人修改
msg="".join([st for st in text if ord(st) in range(65536)]) # 去表情符
print(count,msg) # 打印位置,显得标注有存在感
if count <= position or line.split("\t")[-2] == "0": # 一些跳过的条件,要么特判,要么已经标注过
continue
# 创建GUI,返回点击内容,msg为显示的文本,title为GUI的标题,boxes为选项
choice1=choicebox(msg, title, boxes) -
with open(folder + label_write, 'a',encoding="utf-8") as write_file:
content = line + "\t" + choice1 # 输出内容
write_file.write(content+'\n')
更多推荐
已为社区贡献2条内容
所有评论(0)