Hi There.
My code is functioning well these days ... my first project which is a big project is nearing completion and would like some ways of tidying up some functions.
It's a backup program and when you press a button it backs up a section of your system. Here is the current code for the press button part.
def picbackup():
source = ['-ir!"%USERPROFILE%\*.bmp"', '-ir!"%USERPROFILE%\*.tif"', '-ir!"%USERPROFILE%\*.jpg"', '-ir!"%USERPROFILE%\\*.gif"']
target_dir = '.\\'
today = time.strftime('%d_%m_%Y')
target = '.\\Backup\Pictures_' + today + '.zip'
zip = os.popen ("D:\\Backup\\7Zip\\7z.exe a -bd -ssw {0} {1}".format(target, ' '.join(source)))
shellOutput = zip.read()
zip.close()
outputWindow.delete('1.0',END)
outputWindow.insert('1.0',shellOutput)
if os.system(zip_command) == 0:
print('Successful backup to', target)
else:
print('Backup FAILED')
There is a reference to an output window but it doesn't update till the end and to be honest, i don't need it to and infact even happy to get rid of it, it is just how the code looks today.
So what i'm looking for is a hopefully a much easier solution, replace the output window, but all my research findings seem to point to others looking for "live update of their dos command in a window" whereas i think a more simple solution would be a popup that say "please wait ..." and maybe a small animation to show it is working (i have an anim i would love to use).... once the process is complete, it either disappears by itself OR a small "ok" button can appear which you can click and close this function and back at the main menu. Since i can't find anyone else who has done something like this, i'm not sure quite how to go about this and would love some advice if anyone has any.
Thankyou.