Count the lines of code in your files.
Python 3.9
import os from os import path import Stat FilePath = input('请输入统计目录:') # 输入目录 Stat.scaner_file(FilePath, True) Stat.g_stat()
通过scaner_file的第二个参数控制是否遍历子目录;
- Stat.py
import Stat
- Stat.py
def scaner_file(scPath, isDir):
def g_stat():
def stat_code(file):