website/import_mess/reorder_index.py

17 lines
291 B
Python
Raw Permalink Normal View History

2022-09-28 20:49:59 +00:00
#!/bin/python3
# reorder Index des images
import os
BASE = '../static/files/images/'
l = os.listdir(BASE)
print(l)
for e in l:
if int(e) >= 1000:
os.rename(BASE + e, BASE + str(27+int(e)-1000))
if e.zfill(5) != e:
os.rename(BASE + e, BASE + e.zfill(5))