Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #52117

Re: pexpect, loading an entry field

References <ktqeho$f5i$1@news.albasani.net> <4559802.M7tbXMqQd4@mach-114-20> <CAKuJGC8BTJFKQ0xWUwoMZA78n48n0H7xkPv9yMpTptPk04xjkg@mail.gmail.com> <3630058.GVOTG9cGGT@mach-114-20>
From "Lakshmipathi.G" <lakshmipathi.g@gmail.com>
Date 2013-08-07 13:40 +0530
Subject Re: pexpect, loading an entry field
Newsgroups comp.lang.python
Message-ID <mailman.305.1375863171.1251.python-list@python.org> (permalink)

Show all headers | View raw


Hi -
I'm using Python 2.7.3 (Fedora 17) . I tried a simple example with
pexpect to copy a file to remote system. It works

$ cat pex.py
import pexpect
s = pexpect.spawn ('scp pex.py root@10.30.77.244:/tmp')
s.expect ('Password:')
s.sendline ('a')
s.expect(pexpect.EOF,timeout=20)

Execute above program (change remote ip and password) - If it works
then its not an issue with pexpect or python
environment.


-- 
----
Cheers,
Lakshmipathi.G
FOSS Programmer.
www.giis.co.in



On Tue, Aug 6, 2013 at 11:33 PM, inq1ltd <inq1ltd@inqvista.com> wrote:
>
>
>> pexpect looks simple to use. Please check this example
>
>>
>> http://www.pythonforbeginners.com/systems-programming/how-to-use-the-pexpect
>
>> -module-in-python/
>
>> > python help;
>
>> >
>
>> > I am using pexpect to open my program.
>
>> > Can someone tell me how to get data to appear in
>
>> > an entry field.
>
>> > After pexpect opens the my program I have tried to use
>
>> > send, sendline, and write functions to try to put data into
>
>> > the program's entry field.
>
>> > However, the data is going to the terminal window,
>
>> > the window that is used to initiate the call to pexpect
>
>> > but not to the entry field in the open program.
>
>> > I would appreciate suggestions.
>
>> >
>
>> > jol
>
>> >
>
>
>
> Thanks for the response.
>
>
>
> I have been there but that site gives me
>
> the same information that I get from
>
> noah.org. I have the pexpect docs and they presume
>
> that this problem doesn't exist.
>
>
>
> None of the information in the NOAH site or the FAQ's
>
> address this question.
>
>
>
> I'm using suse linux running python 2.7 and pexpect.
>
>
>
> The data, when using send() method is going to the terminal window,
>
> This is the same window that is used to initiate the call to pexpect.
>
>
>
> Pexpect opens the program but the send method sends
>
> data to the terminal window, not the entry field located
>
> in the child spawned by pexpect.
>
>
>
> interact works, as does close(), TIMEOUT, EOF, before, after,
>
> expect_exact and methods. But the entry field does not
>
> load.
>
>
>
> So my question is;
>
>
>
> Why??
>
>
>
>
>
>
>
>
>
>> >
>
>> >
>
>> >
>
>> > --
>
>> > http://mail.python.org/mailman/listinfo/python-list

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Class hierarchy problem BrJohan <brjohan@gmail.com> - 2013-08-06 11:10 +0200
  Re: Class hierarchy problem Chris Angelico <rosuav@gmail.com> - 2013-08-06 10:30 +0100
    Re: Class hierarchy problem Chris Angelico <rosuav@gmail.com> - 2013-08-06 15:02 +0100
      Re: Class hierarchy problem BrJohan <brjohan@gmail.com> - 2013-08-06 17:36 +0200
        Re: Class hierarchy problem Joe Junior <joe.fbs.junior@gmail.com> - 2013-08-06 13:23 -0300
        Re: Class hierarchy problem Jordi Riera <kender.jr@gmail.com> - 2013-08-06 18:13 +0200
        Re: Class hierarchy problem Chris Angelico <rosuav@gmail.com> - 2013-08-06 18:12 +0100
        Re: Class hierarchy problem Terry Reedy <tjreedy@udel.edu> - 2013-08-06 19:13 -0400
        Re: Class hierarchy problem Ben Finney <ben+python@benfinney.id.au> - 2013-08-07 11:58 +1000
  Re: Class hierarchy problem Peter Otten <__peter__@web.de> - 2013-08-06 11:34 +0200
  Re: Class hierarchy problem Steven D'Aprano <steve@pearwood.info> - 2013-08-06 09:36 +0000
  pexpect,  loading an entry field inq1ltd <inq1ltd@inqvista.com> - 2013-08-06 11:05 -0400
  Re: pexpect, loading an entry field "Lakshmipathi.G" <lakshmipathi.g@gmail.com> - 2013-08-06 22:04 +0530
  Re: pexpect, loading an entry field inq1ltd <inq1ltd@inqvista.com> - 2013-08-06 14:03 -0400
  Re: pexpect, loading an entry field "Lakshmipathi.G" <lakshmipathi.g@gmail.com> - 2013-08-07 13:40 +0530

csiph-web