Short version: How to execute a linux command which requires input after execution using Python?
Long version: I am building some fancy website stuff using Python to give my SVN server a way to be managed easier. (I can't remember all the linux commands)
So I want to create, delete and edit repo's and users using a webpage. I just came to the problem I do not know how to execute the following command using Python:
sudo htdigest /etc/apache2/dav_svn.htdigest "Subversion Repo" [username]
Well I know how to execute the command with os.system()
or subprocess.Popen()
, but the problem is that once that command is executed it asks to enter a password twice before continuing. Using multiple calls using os.system()
or subprocess.Popen()
won't work since they just create a new shell.
Is there a way in Python to let an argument be used once it is required?