Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > add pexpect to the standard library, standard "install" mechanism.

Reply
Thread Tools

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

 
 
funkyj
Guest
Posts: n/a
 
      01-19-2006
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

 
Reply With Quote
 
 
 
 
Fredrik Lundh
Guest
Posts: n/a
 
      01-19-2006
"funkyj" <(E-Mail Removed)> 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>



 
Reply With Quote
 
 
 
 
funkyj
Guest
Posts: n/a
 
      01-19-2006
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

 
Reply With Quote
 
Robert Kern
Guest
Posts: n/a
 
      01-19-2006
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
http://www.velocityreviews.com/forums/(E-Mail Removed)

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

 
Reply With Quote
 
Nick Craig-Wood
Guest
Posts: n/a
 
      01-20-2006
Robert Kern <(E-Mail Removed)> 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 <(E-Mail Removed)> -- http://www.craig-wood.com/nick
 
Reply With Quote
 
funkyj
Guest
Posts: n/a
 
      01-20-2006
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?

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing the system clock with pexpect confuses pexpect! Saqib Ali Python 1 12-26-2011 01:51 PM
pexpect module Gianluca Trombetta Python 8 05-18-2004 11:20 AM
pexpect exceptions Michael Surette Python 2 01-28-2004 02:33 PM
cygwin python with Tkinter and pexpect module =?ISO-8859-15?Q?J=F6rg?= Maier Python 2 09-07-2003 09:05 PM
cannot get pexpect to work Andrei Python 5 08-30-2003 07:20 PM



Advertisments