Based on your code i do not see the percentage printed anywhere.
How do you want to print it at the same time? and where?
I personally see multiple options:
- use Tkinter and use different widgets either on top or next to each other and increase both values at the same time.
- using the console output you could clear the console and print formatted strings based on your process (like "------70%--- " )
If you want to use tkinter
you should first create your script, then try to run it and if you run into errors you can ask a SO Question with specific errors for specific problem sets.
As Bryan mentioned earlier, this is StackOverflow not some kind of "LetMeCodeThatForYou" platform. Nevertheless i will attach some pseudo-code as a hint what could be done.
What you could try in some tkinter code is something like:
import Tkinter as tk
class MyWidget(tk.Window):
def __init__(self, *args, **kwargs):
# [...] for real code there needs to be more in here...
self.percentage=tk.StringVar()
self.progressbarwidget=SomeWidget(self)
self.progressbarwidget.grid()
def increase_counter(step=1):
self.percentage.set("%s%%"%(int(self.percentage.get()[-1:])+step))
self.progessbarwidget.configure(width=width+step)
if self.percentage.get()=="100%":
#destroy the window / widget / whatever here...
self.destroy()
else:
self.after(1000, self.increase_counter)
using something like this in your application would update both at the same time, the percentage Value and the appearance of the widget.
Please note that this is only sample code, some kind of hint how a structure like you want it can be done.
Also have a look over here Python: Is it possible to create an tkinter label which has a dynamic string when a function is running in background?