I think use utils.system() better than commands.*, which "Deprecated since version 2.6: The commands module has been removed in Python 3".