I don't why there is no output....

Discussion in 'Python' started by chad, Dec 25, 2010.

  1. chad

    chad Guest

    Given the following...

    #!/usr/bin/python

    import pexpect

    p = pexpect.spawn('cat')
    p.sendline('1234')
    p.expect (['1234'])
    p.expect (['1234'])

    I no output when I run it...

    [cdalten@localhost oakland]$ ./ecat.py
    [cdalten@localhost oakland]$

    I don't get it. I was expecting to see the output from both the tty
    and cat. Instead, I see nothing. Why?
    chad, Dec 25, 2010
    #1
    1. Advertising

  2. chad

    chad Guest

    On Dec 24, 4:00 pm, chad <> wrote:
    > Given the following...
    >
    > #!/usr/bin/python
    >
    > import pexpect
    >
    > p = pexpect.spawn('cat')
    > p.sendline('1234')
    > p.expect (['1234'])
    > p.expect (['1234'])
    >
    > I no output when I run it...
    >
    > [cdalten@localhost oakland]$ ./ecat.py
    > [cdalten@localhost oakland]$
    >
    > I don't get it. I was expecting to see the output from both the tty
    > and cat. Instead, I see nothing. Why?


    Never mind. I figured it out.
    chad, Dec 25, 2010
    #2
    1. Advertising

  3. On Fri, 24 Dec 2010 16:22:18 -0800, chad wrote:

    >> I don't get it. I was expecting to see the output from both the tty and
    >> cat. Instead, I see nothing. Why?

    >
    > Never mind. I figured it out.


    Well, don't keep us in suspenders. What was the problem?


    --
    Steven
    Steven D'Aprano, Dec 25, 2010
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Richard Lionheart
    Replies:
    3
    Views:
    489
    Richard Lionheart
    Sep 5, 2005
  2. kanchy kang
    Replies:
    2
    Views:
    362
    Magnus Lycka
    Feb 24, 2006
  3. Mr. SweatyFinger

    why why why why why

    Mr. SweatyFinger, Nov 28, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    853
    Mark Rae
    Dec 21, 2006
  4. Mr. SweatyFinger
    Replies:
    2
    Views:
    1,739
    Smokey Grindel
    Dec 2, 2006
  5. John Pritchard-williams
    Replies:
    16
    Views:
    157
    Robert Dober
    Aug 29, 2008
Loading...

Share This Page