By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,292 Members | 1,354 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,292 IT Pros & Developers. It's quick & easy.

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

P: n/a
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

Jan 19 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
"funkyj" <fu****@gmail.com> wrote:
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>

Jan 19 '06 #2

P: n/a
Fredrik Lundh wrote:
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

Jan 19 '06 #3

P: n/a
funkyj wrote:
Fredrik Lundh wrote:
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


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
ro*********@gmail.com

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

Jan 19 '06 #4

P: n/a
Robert Kern <ro*********@gmail.com> wrote:
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.

--
Nick Craig-Wood <ni**@craig-wood.com> -- http://www.craig-wood.com/nick
Jan 20 '06 #5

P: n/a
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?

Jan 20 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.