Python Forum

Full Version: How to copy folder from server to local and vice versa
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

I need to copy file from server and paste it in local machine how to do ?
OK, what have you tried?
from distutils.dir_util import copy_tree
copy_tree("source_path ","destination_path")

This code is working perfectly for local folder but when i am trying to copy folder from server to local then it is not working
Perhaps you could use paramiko to build ssh tunnel and subprocess with rsync to copy the folder.  Or to use subprocess for all tasks. According to this example, it's not quite simple. I've never used paramiko. But this will work on Linux OS. I don't know if there is rsync for Windows.