any help appreciated, and i just came back on discord so i forgot some stuff here.
this code is about encrypting files.
code:
=================Other Configuration================
Usages:
usage = "usage: %prog [options]"
Version
Version = "%prog 0.0.1"
====================================================
Import Modules
import argparse
import os
from prompt_toolkit import processor as ps
def main():
# Create the argument parser
parser = argparse.ArgumentParser(usage=usage, description="Encrypt files")
parser.add_argument('-i', '--input', type=str, dest='inputfile', help="File Input Path For Encryption", default=None)
parser.add_argument('-o', '--output', type=str, dest='outputfile', help="File Output Path For Saving Encrypted Cipher", default=".")
parser.add_argument('-p', '--password', type=str, dest='password', help="Provide Password For Encrypting File", default=None)
# Parse arguments
options = parser.parse_args()
# Input Conditions Checkings
if not options.inputfile or not os.path.isfile(options.inputfile):
print(" [Error] Please Specify Input File Path")
exit(0)
if not options.outputfile or not os.path.isdir(options.outputfile):
print(" [Error] Please Specify Output Path")
exit(0)
if not options.password:
print(" [Error] No Password Input")
exit(0)
inputfile = options.inputfile
outputfile = os.path.join(options.outputfile, os.path.basename(options.inputfile).split('.')[0] + '.ssb')
password = options.password
base = os.path.basename(inputfile).split('.')[1]
work = "E"
ps.FileCipher(inputfile, outputfile, password, work)
return
if name == 'main':
main()