Me? I cheat. When I generate a password for someone, I make it a real pain to remember or type - which encourages them to change it, especially as I also provide a link to the "change password" page / form so they can log in with the new password and immediately change it to one they can remember / type.
To this end, I use this very simple code:
string newPassword = Guid.NewGuid().ToString("B");
Which in Python is:
import uuid
...
newPassword = '{' + str(uuid.uuid4()) +'}'