encryptFile(fileName)

def encryptFile(fileName):
    s = string.lowercase + string.uppercase + string.digits + string.lowercase[
        :5]
encryptionKey = {s[i]: s[i + 5] for i in range(len(s) - 5)}
f = open(fileName, 'r')
line = 1
for line in f:
    for char in line:
        if char.isalnum():
            print(encryptionKey[char])
else:
    print(char)
Encrypting the lines in a file