output on sys.stdout and logfile

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • indiarocks
    New Member
    • Feb 2007
    • 20

    #1

    output on sys.stdout and logfile

    Is there a way in which the all the logging done using pexpect can be sent to stdout as well as a file.

    eg.
    filea = file('output.lo g',"w")
    ssh = pexpect.spawn(' ssh root@1.1.1.1')
    ssh.logfile = filea
    ssh.expect('*as sword',timeout= 5)
    ......

    In the above script, the output would be stored only in the logfile, is there a way in which it can be even be sent to sys.stdout at the same time.

    Thanks
Working...