0
在一個小的wxPython程序中,我使用for循環將文件列表中的項目複製並使用cp副本複製它們。一切都很好,可以在路徑上沒有空格的情況下使用。但是,當引入源時,cp函數找不到我的源代碼。 這裏是我的代碼:cp複製wxPython空間
if f_name in selectedsecondcource:
self.counter += 1
self.toPrint = self.counterText + str(self.counter) + "/" + str(len(selectedList))
self.oncopy.SetLabel(self.toPrint)
src_abs_path = os.path.join(r, file)
src_relative_path = os.path.relpath(src_abs_path, self.twoDirFilename)
dst_abs_path = os.path.join(self.DirDest, src_relative_path)
dst_dir = os.path.dirname(dst_abs_path)
if not os.path.exists(dst_dir):
os.makedirs(dst_dir)
ret = os.system('cp -fr %s %s' % (src_abs_path, dst_abs_path))
任何幫助表示讚賞。 雖然這是我的第一個Python程序我的Python的理解比thisos.system('CP ...東西更好
在夏日:我如何在源這項工作,在他們的目錄名稱空間
?感謝 加文
謝謝Txema - 簡單,當你知道答案... – 2013-05-07 16:52:04