Still \'diving in\' to Python, and want to make sure I\'m not overlooking something. I wrote a script that extracts files from several zip files, and saves the extracted files t
Two small changes...
base_name, ext = os.path.splitext(file_name)
You get two results with distinct meaning, give them distinct names.
file_name = "%s_%d%s" % (base_name, str(counter), ext)
It isn't faster or significantly shorter. But, when you want to change your file name pattern, the pattern is on one place, and slightly easier to work with.