Create user from python script?

Hello.
How could I create user automatically with specified username, homedir and random password?
I'm going to call something from python script:
Code:
add_user_command = "adduser -w random -d " user_sites_dir + " " + system_username
os.system(add_user_command)

Any advice?
 
Back
Top