How do I create a user in Linux using Python? I mean, I know about the subprocess module and thought about calling ‘adduser’ and passing all the parameters at once, but the ‘adduser’ command asks some questions like password, full name, phone and stuff. How would I answer this questions using subprocess?
I’ve seen module called pexpect in this question: Can I use Python as a Bash replacement?. Is there any other standard module?
How do I create a user in Linux using Python? I mean, I know
Share
Use
useradd, it doesn’t ask any questions but accepts many command line options.