import re
from sys import argv
import math

def main(program):
    


if __name__=='__main__':
    # confirm that program is supplied with a file to analyze
    if (len(argv) != 2):
        print('No root directory supplied! Please supply a directory path!')
    else:
        program = argv[1]
        main(program)

@@ -1,13 +1,23 @@
+from re 
 import 
-re
+subn
 %0Afro
@@ -51,32 +51,613 @@
 th%0A%0A
+%0A
 def 
-main(program):%0A    %0A
+allLines(program):%0A    fstr = open(filename)                  %0A    lines = 0%0A    buf_size = 1024 * 1024%0A    read_f = f.read # loop optimization%0A    buf = read_f(buf_size)%0A    while buf:%0A        lines += buf.count('%5Cn')%0A        buf = read_f(buf_size)%0A    return lines%0A%0Adef allComments(program):%0A    fstr = open(path).read()%0A    return re.subn('(/%5C*(%5B%5E*%5D%7C%5B%5Cr%5Cn%5D%7C(%5C*+(%5B%5E*/%5D%7C%5B%5Cr%5Cn%5D)))*%5C*+/)%7C(//.*)',%22%22,fstr)%5B1%5D%0A    %0Adef percentage(part,whole):%0A    return 100 * float(part)/float(whole)%0A    %0Adef main(program):%0A    total = allLines(program)%0A    comments = allComments%0A    print(percentage(comments,total))
 %0A%0Aif

Add reg ex portion