blob: dc1788f0d70bec73dbba9f5d29cbef67f3af0a86 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
import sys, re
def remove_comments(source):
"""
Returns 'source' minus docstrings.
"""
comments = re.findall(r"'''[s\S]*?'''", source)
print(comments)
#return out
filename = '%s' %(sys.argv[1])
output = '%s' %(sys.argv[2])
with open(filename, newline='') as f:
content = f.read()
content = remove_comments(content)
with open(output, 'w') as file_object:
file_object.write(content)
|