Shell commands from within a script

Stefan Antoni sasoft at gmx.de
Wed Nov 14 21:02:11 CET 2001


On Wed, Nov 14, 2001 at 03:42:12PM +0200, Neil Fryer wrote:

> I'm really new to python so if you could please let me know how to execute a 
> command like say, ftp, from within a script it really would be appreciated. 
> As I'm only about half way through my first Python tutorial.
import os
os.system('ftp')

... this executes ftp from within your script.
have a closer look into the os module, there are many other interesting
ways to use commands, pipes, fork()'s and so on.




More information about the Python-list mailing list