List in Subprocess.call

i was enroll in learn python & ethical hacking from scratch. i cant solve this problem.need some help.below was the code, and it fail when run it because some error occurs in list of subprocess.call

import subprocess
import optparse

parser = optparse.OptionParser()
parser.add_option("-i","–interface", dest = “interface”,help = “Interface to change it mac addr”)
parser.add_option("-m","–mac",dest = “new_mac”,help = “New Mac Address”)
(options, args) = parser.parse_args()

subprocess.call([“sudo ip link set dev”, options.interface, “down”])
subprocess.call([“sudo ip link set dev”, options.interface, “address”, options.new_mac])
subprocess.call([“sudo ip link set dev”, options.interface, “up”,])

although i add shell = True behind those list. i got output command line is not complete

Hi Rael,

You have to implement the subprocess call correctly in order for the function to change the interface MAC address. Kindly check out the edit in each subprocess.call()