Re: Problem while doing a cat on a tabbed file with pexpect

2012-01-15 Thread Michael Torrie
On 01/15/2012 05:11 PM, 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 m

Re: Problem while doing a cat on a tabbed file with pexpect

2012-01-15 Thread Steven D'Aprano
On Sun, 15 Jan 2012 09:51:44 -0800, Saqib Ali wrote: > I am using Solaris 10, python 2.6.2, pexpect 2.4 Are you sure about that? As far as I can see, pexpect's current version is 2.3 not 2.4. > I create a file called me.txt which contains the letters "A", "B", "C" > on the same line separated

Re: Problem while doing a cat on a tabbed file with pexpect

2012-01-15 Thread Cameron Simpson
On 15Jan2012 16:14, Saqib Ali wrote: | The file me.txt does indeed contain tabs. I created it with vi. | | >>> text = open("me.txt", "r").read() | >>> print "\t" in text | True | | % od -c me.txt | 000 A \t B \t C \n | 006 | | % ls -al me.txt | -rw-r--r-- 1 myUsermyGroup

Re: Problem while doing a cat on a tabbed file with pexpect

2012-01-15 Thread Saqib Ali
The file me.txt does indeed contain tabs. I created it with vi. >>> text = open("me.txt", "r").read() >>> print "\t" in text True % od -c me.txt 000 A \t B \t C \n 006 % ls -al me.txt -rw-r--r-- 1 myUsermyGroup 6 Jan 15 12:42 me.txt On Jan 15, 6:40 pm, Cameron Simp

Re: Problem while doing a cat on a tabbed file with pexpect

2012-01-15 Thread Saqib Ali
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 syst

Re: Problem while doing a cat on a tabbed file with pexpect

2012-01-15 Thread Cameron Simpson
On 15Jan2012 23:04, Steven D'Aprano wrote: | On Sun, 15 Jan 2012 09:51:44 -0800, Saqib Ali wrote: | > I am using Solaris 10, python 2.6.2, pexpect 2.4 | > | > I create a file called me.txt which contains the letters "A", "B", "C" | > on the same line separated by tabs. | [...] | > Now, clearly t

Re: Problem while doing a cat on a tabbed file with pexpect

2012-01-15 Thread Steven D'Aprano
On Sun, 15 Jan 2012 09:51:44 -0800, Saqib Ali wrote: > I am using Solaris 10, python 2.6.2, pexpect 2.4 > > I create a file called me.txt which contains the letters "A", "B", "C" > on the same line separated by tabs. [...] > Now, clearly the file contains tabs. That is not clear at all. How do y

Problem while doing a cat on a tabbed file with pexpect

2012-01-15 Thread Saqib Ali
I am using Solaris 10, python 2.6.2, pexpect 2.4 I create a file called me.txt which contains the letters "A", "B", "C" on the same line separated by tabs. My shell prompt is "% " I then do the following in the python shell: >>> import pexpect >>> x = pexpect.spawn("/bin/tcsh") >>> x.sendline