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

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

javascript - jquery or ashx not working -

inno setup - TLabel or TNewStaticText - change .Font.Style on Focus like Cursor changes with .Cursor -