MCPcopy Index your code
hub / github.com/geekcomputers/Python / rename

Function rename

Downloaded Files Organizer/move_to_directory.py:51–58  ·  view source on GitHub ↗
(search, ex, dest_path)

Source from the content-addressed store, hash-verified

49
50
51def rename(search, ex, dest_path):
52 count = 0
53 os.chdir(dest_path)
54 for filename in os.listdir():
55 if filename.find(search, 0, len(search) - 1):
56 count = count + 1
57
58 return search + str(count) + "." + ex

Callers 2

add_to_dirFunction · 0.85
rename_directoryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected