import os myhome = "/afs/cern.ch/user/e/egraveri/" eos = "/afs/cern.ch/project/eos/installation/0.3.15/bin/eos.select" for i in xrange(691, 700): os.system(eos+" cp /eos/ship/data/neutrinoBackground/neutrino%s/ship.10.0.Genie-TGeant4.root "%(i)+myhome+"ship.10.0.Genie-TGeant4_n%s.root"%(i))