Spaces:
Runtime error
Runtime error
Upload clean_quotes.py
Browse files- clean_quotes.py +15 -0
clean_quotes.py
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
def clean_file(file_path):
|
| 3 |
+
replacements = {
|
| 4 |
+
"‘": "'", "’": "'",
|
| 5 |
+
"“": '"', "”": '"'
|
| 6 |
+
}
|
| 7 |
+
with open(file_path, "r", encoding="utf-8") as f:
|
| 8 |
+
content = f.read()
|
| 9 |
+
for wrong, right in replacements.items():
|
| 10 |
+
content = content.replace(wrong, right)
|
| 11 |
+
with open(file_path, "w", encoding="utf-8") as f:
|
| 12 |
+
f.write(content)
|
| 13 |
+
print(f"[✓] 스마트 따옴표 제거 완료: {file_path}")
|
| 14 |
+
|
| 15 |
+
clean_file("app.py")
|