2

I currently have the following code:

def run_commands(commands):
    commands = commands.split()
    process = subprocess.run(commands)
    process.stdin.write("password")

output = run_commands("git clone ssh://git@git.com/opt/git/repository.git")

This code works up to process.stdin.write("password"). It's executing the command but then waiting on a password input, however using this write method doesnt write anything into the command window. The solution im looking for is to be able to run a command then type to the same command window so I can enter the password.

  • this post should help you: https://stackoverflow.com/questions/19880190/interactive-input-output-using-python – behold Apr 14 '19 at 02:29

0 Answers0