#πŸ”’ I have this error, for some reason its hy. idk what hy is, so can you help me with this?

25 messages Β· Page 1 of 1 (latest)

subtle sundial
#

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()

earnest needleBOT
#

@subtle sundial

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

night ice
#

what is the error?

subtle sundial
#

ill get it.

#

im a newbie, and here is the error. The original module i tried to install didn't work(possibly because it was outdated so i tried using this alternative.) from prompt_toolkit import processor as ps
ImportError: cannot import name 'processor' from 'prompt_toolkit'

night ice
#

hold on

#

can you explain why you think that the "prompt_toolkit" module has a function named processor?

subtle sundial
#

i didn't originally think prompt toolkit had the function processor. the original toolkit package i was about to install had a error, and i was looking for alternatives.... but there are no answers for me.

night ice
#

I doubt I can help

#

what are you trying to do -- hash a password?

earnest needleBOT
#

django/utils/crypto.py line 70

def pbkdf2(password, salt, iterations, dklen=0, digest=None):```
subtle sundial
#

hmmm... ok ill try

night ice
#

or are you trying to encrypt a file? It's a little hard to tell

subtle sundial
#

im encrypting a file

night ice
#

ok, so read about fernet. I've used it.

#

are you doing this

  • for fun
  • to learn
  • to use in actual software that other people will use
    ?
subtle sundial
#

to learn

night ice
#

good!

subtle sundial
#

its uhh encrypting files with a password protector

night ice
#

sure

subtle sundial
#

?

earnest needleBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.