15 lines
343 B
Python
Raw Permalink Normal View History

import os
def main():
number = 1
for file in os.listdir(os.fsencode(".")):
filename = os.fsdecode(file)
if not filename.endswith(".py"):
os.rename(filename, str(number) + "." + filename.split(".")[1])
number += 1
#print(number)
if __name__ == "__main__":
main()