-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfix_all_comments.py
More file actions
29 lines (24 loc) · 982 Bytes
/
Copy pathfix_all_comments.py
File metadata and controls
29 lines (24 loc) · 982 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import re
with open('Diploma/ВКР_ФИНАЛ_RED.md', 'r', encoding='utf-8') as f:
content = f.read()
# Remove all remaining *** markers and their content
# These are comment markers that should be removed
lines = content.split('\n')
filtered_lines = []
for line in lines:
# Skip lines that are single-row comments (*** text ***)
if line.strip().startswith('***') and line.strip().endswith('***'):
continue
# Skip lines that start with *** but have more content
if line.strip().startswith('***') or '***' in line:
# Remove *** markers but keep the content
line = line.replace('***', '')
filtered_lines.append(line)
content = '\n'.join(filtered_lines)
with open('Diploma/ВКР_ФИНАЛ_RED.md', 'w', encoding='utf-8') as f:
f.write(content)
# Verify
with open('Diploma/ВКР_ФИНАЛ_RED.md', 'r', encoding='utf-8') as f:
check = f.read()
count = check.count('***')
print(f'Remaining *** markers: {count}')