def main(*args):
if len(sys.argv) < 2:
- print 'You must at least specify origin and destination folders.'
+ print('You must at least specify origin and destination '
+ 'folders.')
return 0
origin=sys.argv[1]
dest=sys.argv[2]
if os.path.exists(origin):
if os.path.exists(dest):
if os.listdir(dest)!=[]:
- print 'Destination folder is not empty! Use another folder.'
+ print('Destination folder is not empty! Use '
+ 'another folder.')
return 0
else:
- print 'Destination folder does not exist, will create it'
+ print('Destination folder does not exist, will create '
+ 'it')
os.mkdir(dest)
else:
- print 'You provided a wrong origin folder name, try again.'
+ print('You provided a wrong origin folder name, try again.')
origin=os.path.abspath(origin)
dest=os.path.abspath(dest)
rawdest=rawdest.replace('/','') #for linux
rawdest=rawdest.replace('\\','') #for windows
destfile=os.path.join(dest,rawdest)
- print 'Copying '+rawdest
+ print('Copying '+rawdest)
shutil.copy(filepath,destfile)
return 0