[Tutor] Correct way to call an outside program?

Luke Paireepinart rabidpoobear at gmail.com
Thu Mar 13 23:03:16 CET 2008


Allen Fowler wrote:
> Thank you for the help.  :)
>
> ----- Original Message ----
>
> simplest way to run external commands !
>
> import os
> cmd="/usr/bin/ssh 10.0.0.20 <http://10.0.0.20> uptime"
> os.popen(cmd)
This is deprecated in python 2.5+.  Use subrpocess instead of os.popen 
to make sure your code continues to work in the future.


More information about the Tutor mailing list