FW: Printing to a file and a terminal at the same time

2017-10-12 Thread Lie Ryan
It wouldn't be too difficult to write a file object wrapper that emulates tee, for instance (untested): class tee(object): def __init__(self, file_objs, autoflush=True): self._files = file_objs self._autoflush = autoflush def write(self, buf): for f in self._files

Re: FW: Printing to a file and a terminal at the same time

2017-10-10 Thread Michael Torrie
On 10/10/2017 10:09 AM, Vail, Rick wrote: > I have a script for Cisco devices that will do configuration or any CLI > command. What I would like to do is print the output to my terminal(windows) > and to a file. I can come up with stdout parameters > To print to a file but not to the screen and

Re: Printing to a file and a terminal at the same time

2017-10-10 Thread MRAB
On 2017-10-10 17:00, Vail, Rick wrote: I have a script for Cisco devices that will do configuration or any CLI command. What I would like to do is print the output to my terminal(windows) and to a file. I can come up with stdout parameters To print to a file but not to the screen and when I re

FW: Printing to a file and a terminal at the same time

2017-10-10 Thread Vail, Rick
Follow Presidio on Twitter]<http://www.twitter.com/presidio> From: Vail, Rick Sent: Tuesday, October 10, 2017 7:04 AM To: 'python-list@python.org' Subject: Printing to a file and a terminal at the same time I have a script for Cisco devices that will do configuration or any CLI

RE: Printing to a file and a terminal at the same time

2017-10-10 Thread Vail, Rick
I have a script for Cisco devices that will do configuration or any CLI command. What I would like to do is print the output to my terminal(windows) and to a file. I can come up with stdout parameters To print to a file but not to the screen and when I remove the stdout part it prints to the sc