473,326 Members | 2,128 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

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

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
5 4495
"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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Alexander Skwar | last post by:
Hello! I'm having problems getting PHP 4.3.3RC4 successfully to install on my HP-UX 11.00 server. After a (successfull?) compile, "make install" errors out with this error message: ...
0
by: Charlie O | last post by:
I have created an MSI for delivering a .NET Web application to our field reps. It is a "smart client" application that will reside on their laptops. We want them to all have the application...
2
by: djoefish | last post by:
sequel to the topic "install patch on windows"..... I am currently running Python2.3 with Enthought on a windows PC. I have been running into a memory problem (see...
4
by: Eric West | last post by:
First, thanks for taking the time to read this message. I am trying to build a LAMP stack for the first time, and have encountered the following problem: CentOS 4.3 mysql 4.1.20 apache 2.2.3...
4
by: inetquestion | last post by:
php has been configured with the following two configure lines and core's during "make install" on the PEAR section. Is there something simple i'm missing? Any help would be appreciated. ...
4
by: Stef Mientki | last post by:
hello, after 4 months playing around with Python, and I still have troubles with egg files. Sometimes it works, sometimes it doesn't. If I google on "python egg", I get lost of links, which...
2
by: fartknuckle | last post by:
When I try to build and install python from source It configures and makes fine but upon 'make install' I always get to this point: Listing /usr/local/lib/python2.5/xml/sax ... Compiling...
2
by: bsagert | last post by:
I downloaded Mark Pilgrims's feedparser.py in a zipfile to my Windows machine, unzipped it and tried to install it to no avail. Here is the result => C:\>python...
12
by: dkurth | last post by:
Hi, I'm running PHP 5.2.3 on Windows 2000 Server with IIS 5. I'm trying to get cUrl working, so in my php.ini file, I have this line: extension_dir ="F:\PHP\ext" And later, I have: ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.