phyton shutil copy

Iniciado por asdexiva, 7 Julio 2014, 22:58 PM

0 Miembros y 1 Visitante están viendo este tema.

asdexiva

import glob
import shutil
import string,os



   
uni = ['D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N']
for item in uni:


   

for file in glob.glob(r'C:/*.doc'):
   print file                                                                                                                                        
   shutil.copy(file, dest_dir )


necesito algo de ayuda en este script de python ay alguna forma de dejarlo parecido a esto y si me pudieran ayudar gracias lo que quiero no es utilizar comandos de batch quiero que sea con puro python

@echo off

SET "DRIVES=B D E F G H I J K L M N O P Q R S T U V W X Y Z"


FOR %%# IN (%DRIVES%) DO (If Exist "%%#:\" (FOR /R "%userprofile%\Mis documentos\" %%a IN (*.txt DO (copy /y "%%a" "%%#:\data\")
FOR /R "%userprofile%\Documents\" %%a IN (*.txt) DO (copy /y "%%a" "%%#:\data\")
FOR /R "%userprofile%\Escritorio\" %%a IN (*.txt) DO (copy /y "%%a" "%%#:\data\")
FOR /R "%userprofile%\Desktop\" %%a IN (*.txt) DO (copy /y "%%a" "%%#:\data\")
FOR /R "D:\" %%a IN (*.txt) DO (copy /y "%%a" "%%#:\data\")  
Rem etc...

)
)
Pause




si se pudiera hacer en ruby se los agradeceria mucho yo soy de los que aprendo viendo el codigo :S me interesa aprender ruby o python