Python & autoftp

Donn Cave donn at u.washington.edu
Tue Apr 23 12:35:30 EDT 2002


Quoth davies at jkevin.freeserve.co.uk (kevin):
| I'm pretty new to Python and I would like to develop a script in
| Python to automatically FTP. I have already used bash and expect and
| now would like to replace bash entirely with Python.
|
| Is there any merit in replacing bash with Python??

In general, each is superior in its own domain of application.
More specifically, if your program works fine now, it probably
won't work any better in Python, but you may learn something
about Python and UNIX internals while you're at it.

| Can anyone point me in the right direction.

The expect part is probably the hardest.  I assume you mean to
replace expect too, not just bash.  Look at openpty and forkpty
in the posix ("os") module, and see if you can get them to work
in a little test application (if you even have them.)  There
are also more complete expect solutions, if that's interesting
you might look in the Vaults of Parnassus exit from www.python.org.

Alternatively, whatever you're doing might be done more easily
by replacing ftp itself with ftplib module.  That will make the
expect part unnecessary.

	Donn Cave, donn at u.washington.edu



More information about the Python-list mailing list