
Добавил:
CanyonE
СПбГУТ * ИКСС * Программная инженерия
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:8 семестр / Готовая курсовая работа / MailClient / count_strings
.py import os
import string
printable = set(string.printable).difference(string.whitespace)
c = 0
for root, dirs, files in os.walk("."):
for filename in files:
if filename.endswith('.h') or filename.endswith('.cpp'):
with open(filename, 'r', encoding='utf-8') as fin:
for line in fin.readlines():
c += not bool(set(line).isdisjoint(printable))
print('Count: ' + str(c))
input()
import string
printable = set(string.printable).difference(string.whitespace)
c = 0
for root, dirs, files in os.walk("."):
for filename in files:
if filename.endswith('.h') or filename.endswith('.cpp'):
with open(filename, 'r', encoding='utf-8') as fin:
for line in fin.readlines():
c += not bool(set(line).isdisjoint(printable))
print('Count: ' + str(c))
input()
Соседние файлы в папке MailClient