0

I am new at python & am trying to make a mass file coping python script, which should copy a single file in a DIR and in its subdir. I have found a script but it has an error:

import os, sys, time 
time.sleep(1) 
path = sys.argv[1] 
file = sys.argv[2] 
exe = "find %s -name "index.*" -exec cp %s {} ;" % (path, file) 
os.system(exe)

I have also tried this system command 'cp -r file /path/**' with * i can determine how deeper I wanna copy my file into a dir this command works fine but I can't do it with python while having file & path as 2 variables.

MartinTeeVarga
  • 10,478
  • 12
  • 61
  • 98

0 Answers0