Alioune,
la syntaxe correcte est:

# copy file with python
def copy(s,d):
    try:
        s=open(s,'r')
        d=open(d,'w')
        d.write(s.read())
    finally:
        s.close()
        d.close()

Mais probablement il est plus simple et plus court d'utiliser shutil qui fait 
partie de la librairie standard ;)
http://docs.python.org/library/shutil.html?highlight=shutils#shutil.copy


from shutil import copy
copy(s,d)


-- 
Karl Dubost
Montréal, QC, Canada
http://www.la-grange.net/karl/


--
Ce message a été envoyé à la liste [email protected]
Gestion de votre abonnement : http://dakarlug.org/liste
Archives : http://news.gmane.org/gmane.org.user-groups.linux.dakarlug
Le site du DakarLUG : http://dakarlug.org

Répondre à