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

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

2017-10-10 Thread Vail, Rick
Rick Vail | Network Engineer Presidio (NASDAQ: PSDO) | www.presidio.com 12272 Hancock St, Carmel, IN 46032 D: 317.428.6399 | C: 317.847.0493 | rv...@presidio.com [Future. Built.] Follow us: [Follow Presidio on Tw