def createUser(username,password):
password = crypt.crypt(password,"$5$a1")
os.system("sudo useradd -p '#{password}' -m "+username)
createUser("lesson1",idhash)
This is the code I have for creating user accounts so far, but each time the user account is created the password that is inserted in the method definition is not the password for the newly created account.