
ICH DANKE EUCH ALLEN VIELMALS!!!!




ihr seid die besten echt^^
das hat mir jetzt ca 1ne woche sucharbeit erspart!!^^


ne ehrlich jetzt THX AN ALLE!!!! vorallem jens muss ich danken^^
aber trotzdem ALLEN EINEN GREATEN DANK!!!!
Code: Alles auswählen
for path in filelist:
Ja...SvL_Striker hat geschrieben: ist das richtig? xD xD xD xD
Code: Alles auswählen
# -*- coding: iso-8859-15 -*-
import os, shutil
SOURCE_ROOT = r"blubb"
DEST_DIR = r"bilder"
PICTURELIST_FILE = r"bilderliste.txt"
def search(picturelist):
found = []
for root, dirs, files in os.walk(SOURCE_ROOT):
found += [os.path.join(root, item) for item in picturelist if item in files]
return found
f = open(PICTURELIST_FILE, "r")
picturelist = f.read().strip().split("\n")
f.close()
for item in search(picturelist):
destfile = os.path.join(DEST_DIR, os.path.basename(item))
cnt = 1
while True:
if not os.path.exists(destfile):
break
elif os.path.exists(destfile + "-" + str(cnt)):
cnt += 1
else:
destfile += "-" + str(cnt)
break
print "Copying '%s' to '%s'" % (item, destfile)
shutil.copyfile(item, destfile)
Code: Alles auswählen
bild1.jpg
bild2.png
bild3.bmp