INNER CODE UNIT · Python

indexHeader

Haeri/PhotonBox · scripts/code_checker.py:30

def indexHeader(item):
	global header_loc
	all_header.append(item)
	header_loc += sum(1 for i in open(item, 'rb'))

def indexCpp(item):
	global cpp_loc
	all_cpp.append(item)
	cpp_loc += sum(1 for i in open(item, 'rb'))

def indexAll():
	pathwalk(header_path, (".h"), indexHeader)
	pathwalk(cpp_path, (".cpp"), indexCpp)

def countFiles():
	print("Total lines of code: \t\t\t" + str(header_loc + cpp_loc))
	print("Total lines of code in Headers:\t\t" + str(header_loc))
	print("Total lines of code in CPP files:\t" + str(cpp_loc))

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…