Hello! I'm trying to find a way to make something along the lines of Text File 1.txt, and if that's already made, then Txt File 2.txt, and so on.
DG stands for Date Group (not shown here, but that's because it works just fine).
DG stands for Date Group (not shown here, but that's because it works just fine).
k = 1 def OpenUp(k): try: f = open(dg + ' Police Report ' + str(k) + '.txt','x+') return i except: k += 1 OpenUp(k) i = OpenUp(k) f = open(dg + ' Text File ' + str(i) + '.txt','x+')