469,286 Members | 2,521 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,286 developers. It's quick & easy.

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.log',"w")
ssh = pexpect.spawn('ssh root@1.1.1.1')
ssh.logfile = filea
ssh.expect('*assword',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
Feb 15 '07 #1
0 1268

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Orr, Steve | last post: by
3 posts views Thread by -H | last post: by
12 posts views Thread by Matt Garman | last post: by
5 posts views Thread by Carl Castrianni | last post: by
14 posts views Thread by nathan.shair | last post: by
2 posts views Thread by Guillaume Dargaud | last post: by
5 posts views Thread by amit.uttam | last post: by
1 post views Thread by Anh Khuong | last post: by
reply views Thread by Lie Ryan | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.