reindent.py hinzugefügt
This commit is contained in:
18
reindent.py
Normal file
18
reindent.py
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
# 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}")
|
||||||
Reference in New Issue
Block a user