from Decryptor.py import decryptor
userInput = int(input("What mode do you want to select? (1-4) "))
if userInput == 3:
decryptor()
^this is the function that is executing as soon as the program is run regardless of whether the parameters for the if statement is met
#This code is from Decryptor.py
import os
from cryptography.fernet import Fernet
def decryptor():
fileName = input("What is the name of the file you want to decrypt (case sensitive) ")
with open(fileName+".key", "rb")as file:
key = file.read()
key = Fernet(key)
with open(fileName+".json", "rb")as encryptedFile:
passwordFile = encryptedFile.read()
decrypt = key.decrypt(passwordFile)
with open(fileName+".json", "wb")as decryptedFile:
decryptedFile.write(decrypt)
print("Your file has been decrypted.")
decryptor()
^and this is the function itself that is executing before anything else in the program