ich habs nach langer Zeit mal wieder geschaft mir ein script zu basteln.
Ich fänds klasse, wenn Ihr mir ein paar Tipps gebt, was ich besser machen kann.
Ich fang ja gerade erst mit Python an.
Also hier kommt der code:
Code: Alles auswählen
fileSourcePts = "bl05.pts"
textSourceTif = "05.tif"
textSourceJpg = "05.jpg"
fileOutput = "NewBl"
def allFiles():
global ZeiJpg
global ZeiTif
global ZeiPts
for count in range(1,13):
num = str(count)
ZeiJpg = ((num.zfill(2) + ".jpg"))
ZeiTif = ((num.zfill(2) + ".tif"))
ZeiPts = ((num.zfill(2) + ".pts"))
replaceText()
def replaceText():
tmpFile = open(fileSourcePts, "r")
firstRun = tmpFile.read()
tmpFile.close()
tmpFile = open((fileOutput + ZeiPts), "w")
secondRun = firstRun.replace(textSourceJpg, ZeiJpg)
tmpFile.write(secondRun.replace(textSourceTif, ZeiTif))
tmpFile.close()
filePrint = str(fileOutput + ZeiPts)
print (filePrint + ":created and saved...")
#Hauptprogramm
allFiles()