请问tkinter 进度条怎么加到程序里
请问tkinter 进度条怎么加到程序里,我这个程序是用来做文件处理的,我想加个进度条,不知道怎么加进去,我网上看了好多都是 for in range,可是我这个用不到,源码在下面,谢谢import reimport os
from tkinter import *
from tkinter.filedialog import askdirectory
from tkinter.filedialog import askopenfilename
# File: readline-example-3.py
def selectfile():
openfile1 = askopenfilename(title="目标文件",initialdir="c:",filetypes=[('TXT', 'txt')])
directory = os.path.split(openfile1)
tarpath = os.path.join(directory,"shoujihao.txt")
pattern = re.compile(r'^(13|14|15|16|17|18|19)\d{8})
# file = open(r"C:\Users\Administrator\Desktop\/vbs\ivr_callee.txt",'r',encoding='utf-8')
file = open( openfile1, 'r', encoding='utf-8')
while 1:
lines = file.readlines(100000)
if not lines:
break
for line in lines:
m = pattern.findall(line)
# print(m)
if m:
# print(line)
with open(tarpath, "a") as f1:
f1.write(line)
# t.start()
root = Tk()
root.title('手机号整理')
root.resizable(0,0)
root.geometry('250x150')
Button(root, text = "路径选择", command = selectfile).pack()
# print(file)
root.mainloop() 没有人知道吗 论坛已经有人发过教程了呀 教程 小伤口 发表于 2021-9-1 12:48
教程
用progressbar吧,省得画了,谢谢,
页:
[1]