add pexpect to the standard library, standard "install" mechanism.

F

funkyj

I love pexpect because it means I may never have to use expect again (I
don't do any heavy expect lifting -- I just need simple tty control)!

As a python advocate I find it embarassing how difficult it is do the
following in python (without pexpect):

- logon to a remote system using ssh
- do an 'ls' and exit the remote shell
- print the output from the remote shell session.

pexpect, of course, makes this childs play (see the pexpect sshls.py
example for one way to do this).

I'm surprised that, as useful as pexpect is, it has not been included
in the standard python library. How can we get this wonderful package
in the standard library?

TANGENT: it would be nice if python included a standard "tarfile
install" program to make installing 3rd party packages like pexpect
easier.

bash $ pinstall_tarfile foo-pkg.tgz

This install program would
+ look at your sys.path for a suitable install directory
+ check for appropriate directory permissions
+ check whether the tarfile extracts to the CWD or a subdir
(the rest of the script is adjusted accordingly -- assume subdir
behavior).
+ tell the user where you plan to install the package. confirm
that this is OK.
+ extract the tarfile and create/update the foo.pth file.

Perhaps such an install script is already in the standard python
library and I just haven't stumbled across it?

Regards,
--jfc
 
F

Fredrik Lundh

funkyj said:
I love pexpect because it means I may never have to use expect again (I
don't do any heavy expect lifting -- I just need simple tty control)!

As a python advocate I find it embarassing how difficult it is do the
following in python (without pexpect):

- logon to a remote system using ssh
- do an 'ls' and exit the remote shell
- print the output from the remote shell session.

pexpect, of course, makes this childs play (see the pexpect sshls.py
example for one way to do this).

I'm surprised that, as useful as pexpect is, it has not been included
in the standard python library. How can we get this wonderful package
in the standard library?

TANGENT: it would be nice if python included a standard "tarfile
install" program to make installing 3rd party packages like pexpect
easier.

bash $ pinstall_tarfile foo-pkg.tgz

This install program would
+ look at your sys.path for a suitable install directory
+ check for appropriate directory permissions
+ check whether the tarfile extracts to the CWD or a subdir
(the rest of the script is adjusted accordingly -- assume subdir
behavior).
+ tell the user where you plan to install the package. confirm
that this is OK.
+ extract the tarfile and create/update the foo.pth file.

Perhaps such an install script is already in the standard python
library and I just haven't stumbled across it?

any special reason why pexpect cannot ship with a standard distutils
setup.py file (or even egg support) ?

</F>
 
F

funkyj

Fredrik said:
any special reason why pexpect cannot ship with a standard distutils
setup.py file (or even egg support) ?

<googles distutils>

Oh, apparently there is a standard/builtin python distribution
mechanism called 'distutils'.

I guess on the install issue my only suggestion would be for the
pexpect README to say something like:

To install this package on your system run:

bash$ python setup.py install

I read the pexpect README file but it didn't say the bit above and I
had never heard of distutils.

Thanks Fredrik!
--jfc
 
R

Robert Kern

funkyj said:
<googles distutils>

Oh, apparently there is a standard/builtin python distribution
mechanism called 'distutils'.

I guess on the install issue my only suggestion would be for the
pexpect README to say something like:

To install this package on your system run:

bash$ python setup.py install

http://pexpect.sourceforge.net

"""
Installing Pexpect

The pexpect-current.tgz tarball is a standard Python Distutil distribution.

1. download pexpect-current.tgz
2. tar zxf pexpect-current.tgz
3. cd pexpect-current
4. python setup.py install
"""

--
Robert Kern
(e-mail address removed)

"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
 
N

Nick Craig-Wood

Robert Kern said:
Installing Pexpect

The pexpect-current.tgz tarball is a standard Python Distutil distribution.

1. download pexpect-current.tgz
2. tar zxf pexpect-current.tgz
3. cd pexpect-current
4. python setup.py install

If on linux you can

python setup.py bdist_rpm

which builds an .rpm to install which you might prefer.

If you want a .deb use alien to convert the rpm

However in the case of this package

apt-get install python-pexpect

works for me on Debian and hence probably on ubuntu.
 
F

funkyj

Yeah, going back to the sourceforge site now I see the install
instructions you quote above.

Perhaps I'm spoiled by all the FSF packages I've dealt with over the
years. In addition to being impatient I expect the README file to
either tell me how to install the product or direct me to the INSTALL
file in the package that has the install instructions.

Back to my other question, how can I lobby to have pexpect added to the
standard python library?
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,832
Latest member
GlennSmall

Latest Threads

Top