Python Pexpect returns two different outputs -


i have used below code pass password application. 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 executed in command line value return "0", executed through web browser returns value "1". want pass password web application text box how achieve this?

thanks in advance.

thanks
jana

the return value of pexpect.spawn.expect printing out index of string position in stream. being 0 or 1 doesn't success.
notice not sending password itself, should use child.sendline send password after expect has finished.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -