import sys
# Here are the arg that we are going to import from command line to be able to use them.
arg1 = str(sys.argv[1]) # incoming command line arguments
arg2 = str(sys.argv[2])
arg3 = str(sys.argv[3])
arg4 = str(sys.argv[4])
arg5 = str(sys.argv[5])
arg6 = str(sys.argv[6])
arg7 = str(sys.argv[7])
arg8 = str(sys.argv[8])
space = ' '
upper =['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
lower =['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
if(arg8 == "enc"):
key = int(arg6) # the key to be use for encryption
file1 = open(arg4, "a")
with open(arg2, 'r') as r:
for line in r:
for i in range(0,len(line)):
if(line[i] != space):
for j in range(0,26):
if(line[i] == lower[j]): #compare so i can encrytion my letters
if((j+int(key))>25):
file1.write(lower[((j+int(key))%25)-1])
else:
file1.write(lower[j+int(key)])
elif(line[i] == space):
file1.write(space)
print()
file1.close() # We need to closed the file
When i am trying to do encryption for a word with upper and lower letter is not working and i am trying to insert a command or something to do my code case insensitive