pour le moment la copie est bien effectuée,mais je n'arrive pas a modifié le nom( en l’occurrence j,aimerai enlevé les 5 premiers caractères.
1 2 3 4 5 6 7 8 9 10 11
| import os.path
import shutil
from os.path import basename, splitext
source_pth = os.path.abspath("D:/IN/")
source = os.listdir(source_pth)
destination = os.path.abspath("D:/OUT/")
for files in source:
if files.endswith(".txt"):
shutil.copy(os.path.join("D:/IN/",files, destination) |
je sais que je dois employé ceci
mai je n'arrive pas au résultat .
merci
Partager