You can use the following code:
import subprocess
import time
import random
ip=['00:11:22:33:44:55','23:53:21:53:89:92','88:18:12:59:19:88']
ip1=random.choice(ip)
while(True):
subprocess.call(["sudo","ifconfig","ens33","down"])
subprocess.call(["sudo","ifconfig","ens33","hw","ether",ip1])
subprocess.call(["sudo","ifconfig","ens33","up"])
time.sleep(30)