19 lines
420 B
Python
19 lines
420 B
Python
# reindent.py
|
|
import sys
|
|
|
|
in_path = sys.argv[1]
|
|
out_path = sys.argv[2]
|
|
|
|
with open(in_path, 'r', encoding='utf-8') as f:
|
|
lines = f.readlines()
|
|
|
|
fixed = []
|
|
for line in lines:
|
|
# Tabs → 4 Spaces, Strip trailing Spaces
|
|
new = line.expandtabs(4).rstrip()
|
|
fixed.append(new + '\n')
|
|
|
|
with open(out_path, 'w', encoding='utf-8') as f:
|
|
f.writelines(fixed)
|
|
print(f"Neu eingerückt und gespeichert: {out_path}")
|