# Revision history [back]

Python's subprocess module is a good tool for this.

sage: import subprocess
sage: ret = subprocess.call(['ls', '-al'])
drwxr-xr-x  17 palmieri  palmieri   578 May  5 09:02 Applications
drwx------+ 13 palmieri  palmieri   442 Aug 10 13:20 Desktop
drwx------+ 27 palmieri  palmieri   918 Jun  1 08:57 Documents

The first argument to subprocess.call is a list: the first entry is the command, and the remaining entries are its arguments. It returns the return code. You should be able to put this into your code:
import subprocess