好的,所以我正在开发一个应用程序,它允许用户在菜单中选择文件对象,并允许他们将所述选择复制到另一个位置。到目前为止,我已经设法使用 pywin32 模块来允许我使用 Windows 的本机文件复制器来复制文件。
它的代码:
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 )
)
这是在 Windows 下复制的好方法,但我想知道是否有办法在 Mac 和/或 Linux 下实现相同的目标。