I am new to python. I am reading about the crypt() function for UNIX passwords.
import crypt
crypt.crypt("egg","HX")
Here is what I get after running my program
File "...", line 2, in <module> crypt.crypt("egg","HX")
TypeError: 'module' object is not callable
I've read several posts on google and stackOverflow and found that I have to import the library so:
from crypt import *
crypt.crypt("egg","HX")
but now I am getting this error:
Traceback (most recent call last):
File "crypt.py", line 1, in <module>
from crypt import *
File "...", line 2, in <module>
crypt.crypt("egg","HX")
NameError: name 'crypt' is not defined
How can this error be resolved? And what is the difference between
import smth
and
from smth import smth1?
Thank you!