I am creating a GUI to facilitate some of the task in UNIX. I would like to launch a process throught Terminal in UNIX. I used the module of
subprocess.Popen()
to launch the process. The problem is that when i launch the process, the process demands the user, their password. I am thinking of creating a window to ask the user for their password. How can i send the password typed in the window to the process launch in the Terminal?
here is the code:
password = wx.TextEntryDialog(None, "What is your password?", 'Password')
if password.ShowModal() == wx.ID_OK:
response = password.GetValue()
command = 'ssh -X pcalcul0 firefox http://qualnetsrv/intraqual//identification.aspx?ref=G0-1427'
user_manual = subprocess.Popen(command, universal_newlines=True,
stdin=response,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
shell=True)