import subprocess
import sys
password_d=raw_input("Input password")
prog = subprocess.Popen(['runas', '/user:KP\svc','cmd.exe'],universal_newlines=True,stdin=subprocess.PIPE,stdout=sys.stdout)
prog.stdin.write(password_d)
prog.communicate()[0]
This is my code. I am trying to login as another user through runas.exe and provide the password through already stored input object password_d which is taken from the user.
When i try to do this it says the password is incorrect. How can i achieve this in python and how can i print what is being fed as input. any leads would really be helpful.