'why i get this? , line 17 subprocess.call(["ifconfig", interface, "down"]) ^ SyntaxError: invalid syntax
#!/usr/bin/python3
import subprocess
import optparse
def get_arguments():
parser = optparse.OptionParser()
parser.add_option("-i", "--interface", dest="interface", help="goo")
parser.add_option("-m", "--mac", dest="new_mac", help="yeees")
return parser.parse_args()
def change_mac (interface, new_mac):
print ("changing MAC ADDRESS FOR :{} to {}" (interface, new_mac)
subprocess.call(["ifconfig", interface, "down"]) ## the problem
subprocess.call(["ifconfig", interface, "hw ", " ether ", new_mac])
subprocess.call(["ifconfig", interface, "up"])
get_arguments()
change_mac (options.interface, options.new_mac)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

