Reputation: 1124
I am writing an automation script in python and I need to cvs update from script.
In bash my commands look like this:
cvs login
CVS Password: <here i enter the password>
cvs update -P -d
I was using the sub-process module in python to do this, but it fails when it asks for the password.
Any ideas?
Upvotes: 0
Views: 1520
Reputation: 486
Generally you can pass as arguments like this simplified code:
## program run.py
def print_args(name, passwd):
print name
print passwd
## calling program
import run
input_name = raw_input("Enter name ")
input_passwd = raw_input("Enter password ")
run.print_args(input_name, input_passwd)
Upvotes: 1
Reputation: 6536
The pyCVS module can help you sovle the problem by using a binding.
In general, subprocesses have been, in my experience, much more trouble than just using a library that accomplishes the same thing.
Upvotes: 3