Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; '>in': 0.07; 'redirected': 0.07; 'subject:while': 0.07; 'tab': 0.07; 'python': 0.08; 'context.': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:80.91.229.12': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:lo.gmane.org': 0.09; 'subject:Problem': 0.09; 'output': 0.10; 'subject:file': 0.13; 'question.': 0.15; 'ah...': 0.16; 'bieber': 0.16; 'email addr:ix.netcom.com': 0.16; 'email name:wlfraed': 0.16; 'from:addr:ix.netcom.com': 0.16; 'from:addr:wlfraed': 0.16; 'from:name:dennis lee bieber': 0.16; 'message-id:@4ax.com': 0.16; 'received:wlfraed': 0.16; 'simplified': 0.16; 'url:netcom': 0.16; 'url:wlfraed': 0.16; 'wulfraed': 0.16; 'wrote:': 0.16; 'alternate': 0.18; 'jan': 0.19; 'file,': 0.21; 'url:home': 0.21; '>the': 0.23; 'end,': 0.23; 'received:166': 0.23; 'command': 0.24; 'posted': 0.27; "i'm": 0.27; 'remote': 0.27; 'lee': 0.28; 'example': 0.28; 'host': 0.30; 'handling': 0.30; 'characters,': 0.30; 'sun,': 0.30; 'does': 0.32; 'actual': 0.32; "can't": 0.32; 'to:addr:python-list': 0.33; 'character': 0.34; 'size,': 0.34; 'rather': 0.34; 'header:X-Complaints-To:1': 0.34; 'operating': 0.35; 'issue': 0.35; 'file': 0.35; 'charset:us-ascii': 0.36; 'received:org': 0.37; 'some': 0.38; 'subject:with': 0.38; 'open': 0.38; 'characters': 0.38; 'itself.': 0.38; 'processing': 0.39; 'why': 0.39; 'doing': 0.39; 'subject:: ': 0.39; 'to:addr:python.org': 0.40; 'your': 0.61; 'ali': 0.67; 'transfer': 0.72; 'dennis': 0.73; 'spaces': 0.73; '-0800': 0.84; 'saqib': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dennis Lee Bieber Subject: Re: Problem while doing a cat on a tabbed file with pexpect Date: Sun, 15 Jan 2012 22:35:46 -0500 References: <4008c5d1-98c5-4796-9e82-0e8835fbe42a@i25g2000vbt.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: mobile-166-147-100-071.mycingular.net X-Newsreader: Forte Agent 6.00/32.1186 X-No-Archive: YES X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 26 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1326684966 news.xs4all.nl 6965 [2001:888:2000:d::a6]:60634 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:19027 On Sun, 15 Jan 2012 16:11:27 -0800 (PST), Saqib Ali wrote: > >Very good question. Let me explain why I'm not opening me.txt directly >in python with open. > >The example I have posted is simplified for illustrative purpose. In >reality, I'm not doing pexpect.spawn("/bin/tcsh"). I'm doing >pexpect.spawn("ssh myuser@ipaddress"). Since I'm operating on a remote >system, I can't simply open the file in my own python context. > Ah... Now we are outside of my experience... And into the realms of how your remote host is handling tab characters when sent to an (apparent) console (stdout not redirected to a file)... That is, does it expand \t into spaces on the next multiple of 8 characters, or some other size, rather than issue the tab character itself. Is it an actual file on the remote end, or the output from some interactive session? If an actual file, can you find an alternate command to transfer the file to a local path for file processing (ftp, scp, ?). -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/