# Create user from python script?



## solshark (Sep 1, 2009)

Hello.
How could I create user automatically with specified username, homedir and random password?
I'm going to call something from python script:

```
add_user_command = "adduser -w random -d " user_sites_dir + " " + system_username
os.system(add_user_command)
```

Any advice?


----------



## aragon (Sep 2, 2009)

Use pw(8).


----------



## solshark (Sep 2, 2009)

Thx. Works for me.


----------

