实现统计代码行数: 1.首先在url.py中配置 from django.conf.urls import url from django.contrib import admin from app01 import views urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^upload/', views.upload), ] 2.写视图函数:实现统计代码的行数以及注释行数,其中以.py文件为例,注释是以“#”或者““”“”“”