Merge branch 'master' of gitea.sec.tu-bs.de:y0085044/Exercise-01

This commit is contained in:
2020-11-22 23:16:01 +01:00

14
src/libex01.py Normal file
View File

@@ -0,0 +1,14 @@
# file: read_plaintext.py
# module to read plaintext from a file into a string variable.
# Skips non-alphabetic characters and converts the rest to lower case
import string
def read_plaintext(file_path):
txt = ""
with open(file_path, "r") as _file:
for line in _file:
for char in line:
if char in string.ascii_letters:
txt += char
return txt