# -*- coding: utf-8 -*-
'''
Author: LQD
QQ: 743701947
'''
import sys
import os
count = 0
def run_check(dir_path):
global count
file_list = os.listdir(dir_path)
# print(file_list)
for file in file_list:
if os.path.isfile(dir_path + '/' + file):
# print(dir_path + '/' + file)
with open(dir_path + '/' + file, 'rb') as f:
for index, line in enumerate(f):
print(line)
count += 1
elif os.path.isdir(dir_path + '/' + file):
# print(dir_path + '/' + file)
run_check(dir_path + '/' + file)
if __name__ == '__main__':
dir_path = r'{}'.format(sys.argv[1])
run_check(dir_path=dir_path)
print('Code rows: {}'.format(count))