特定のフォルダの中にあるファイルからタスクを抜きだしその個数をカウントするPythonスクリプト
ださださなコードですが、一応動きます。
code:taskscan.py
import os
for curDir, dirs, files in os.walk("."):
for f in files:
if f.lower().endswith(('.txt', '.md')):
targetFile = os.path.join(curDir, f)
with open(targetFile) as g:
lines = g.readlines()
l_task = [line for line in lines_strip if ' ' in line]
if l_task:
print(os.path.join(curDir, f) + " 残りタスク" + str(len(l_task)) + "個:" + "*" * len(l_task)