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

hibernate - How to load global settings frequently used in application in Java -

python 3.x - Mapping specific letters onto a list of words -

objective c - Ownership modifiers with manual reference counting -