import subprocess interface = \'wlan0\' address = \'00:11:22:33:44:66\' subprocess.call(\'ifconfig\' + interface + \'down\', shell=True) subprocess.call(\'ifconfig\