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

Discussion in 'Python' started by funkyj, Jan 19, 2006.

  1. funkyj

    funkyj Guest

    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
     
    funkyj, Jan 19, 2006
    #1
    1. Advertising

  2. "funkyj" <> 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>
     
    Fredrik Lundh, Jan 19, 2006
    #2
    1. Advertising

  3. funkyj

    funkyj Guest

    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
     
    funkyj, Jan 19, 2006
    #3
  4. funkyj

    Robert Kern Guest

    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


    "In the fields of hell where the grass grows high
    Are the graves of dreams allowed to die."
    -- Richard Harter
     
    Robert Kern, Jan 19, 2006
    #4
  5. Robert Kern <> 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 <> -- http://www.craig-wood.com/nick
     
    Nick Craig-Wood, Jan 20, 2006
    #5
  6. funkyj

    funkyj Guest

    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?
     
    funkyj, Jan 20, 2006
    #6
    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. Mark McEahern
    Replies:
    1
    Views:
    451
    Duncan Booth
    Feb 2, 2004
  2. steve.leach

    How standard is the standard library?

    steve.leach, Apr 18, 2005, in forum: Python
    Replies:
    1
    Views:
    419
    Christos TZOTZIOY Georgiou
    Apr 18, 2005
  3. Tom
    Replies:
    7
    Views:
    273
    Vinay Sajip
    Jun 4, 2010
  4. Saqib Ali
    Replies:
    1
    Views:
    381
    Roy Smith
    Dec 26, 2011
  5. Replies:
    7
    Views:
    118
    Rick DeNatale
    Mar 31, 2007
Loading...

Share This Page