Jump to content

Dúvida simples sobre pycrypto


Recommended Posts


Boa Tarde.

Alguém me saberá dizer qual é a diferença entre isto:

from Crypto.Cipher import ARC4

e isto:

from Crypto.Cipher import ARC4 as cipher

O segundo importa o ARC4 como cipher. Tudo bem. Mas qual é a diferença?

Desde já agradeço muito a vossa ajuda.

Link to post
Share on other sites

Na primeira para acederes ao que importaste usas o nome ARC4 e na segunda usas o nome cipher.

>>> from random import randint
>>> randint(1, 10)

>>> from random import randint as aleatorio
>>> aleatorio(1, 10)
>>> randint
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'randint' is not defined

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.