Okay, so I'm developing an application that will allow users to select file objects in a menu and will allow them to copy said selections to another location. I have so far managed to use the pywin32 module to allow me to copy files using Windows' native file copier.
The code for it:
from win32com.shell import shell, shellcon
srcstr = chr( 0 ).join( [ file[0] for file in files ] )
deststr = chr( 0 ).join( [ file[1] for file in files ] )
shell.SHFileOperation(
( 0, shellcon.FO_COPY, srcstr, deststr, shellcon.FOF_MULTIDESTFILES, None, None )
)
This is a fine method for copying under Windows, but I was wondering if there is a way to accomplish the same goal under Mac and/or Linux.
Have you considered shutil (http://docs.python.org/library/shutil.html)? This module provides that sort of high-level file operations while remaining os-agnostic.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With