By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,638 Members | 2,204 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,638 IT Pros & Developers. It's quick & easy.

Progress Bar when copying files

ryno du preez
P: 91
Hello All
I'm new to Python And tkinter
With that said I'm trying to write a simple code to show a progress bar while I'm copying files from one directory to another one. But all my efforts has turned out to be a waste of time. I wold really appreciate any help on this. The end result will be a Gui for the user to click on and the copy process will start.
Expand|Select|Wrap|Line Numbers
  1. import os
  2. import shutil
  3. # make sure that these directories exist
  4. dir_src = "Source directory"
  5. dir_dst = "Destination"
  6. for file in os.listdir(dir_src):
  7.     print file  # testing
  8.     src_file = os.path.join(dir_src, file)
  9.     dst_file = os.path.join(dir_dst, file)
  10.     shutil.copytree(src_file, dst_file) 
  11.  
Jul 20 '16 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.