pexpect.spawn returns various output from web and terminal

pexpect.spawn returns various output from web and terminal

Postby janaefx » Tue Apr 08, 2014 12:02 pm

Hi All,

I have used the below code to pass the password to my application. It gives different output.

import pexpect

child=pexpect.spawn("mycommand")
i=child.expect(["Password:",pexpect.EOF])
print "Content-type:text\html\n\n Success"+str(i)

First I executed in command line the i value return "0", then I executed through web browser it returns a value "1". I want to pass the password from my web application text box how to achieve this?

Thanks in advance.

Thanks
Jana
janaefx
 
Posts: 3
Joined: Tue Apr 08, 2014 4:48 am

Return to Web Development

Who is online

Users browsing this forum: No registered users and 2 guests

cron