Executing a shell command

Pierre Fortin pfortin at pfortin.com
Sat Jun 2 16:02:42 CEST 2001


Kevin Riggle wrote:
> 
> Is there any way to take a command in a string in Python, execute it in the
> shell, and read the output into a variable of some sort, like
> 
> result = execute(cmdline)

result = os.popen(cmdline).read()

Pierre



More information about the Python-list mailing list