dns 三台,分别选出一台和两台
#!/usr/bin/env python import random resolv_servers = ['192.168.1.1', '192.168.1.2', '192.168.1.3'] # 选出一个 print random.choice(resolv_servers) # 选出两个,做为一个列表 print random.sample(resolv_servers, 2)
Think before you speak, read before you think.
dns 三台,分别选出一台和两台
#!/usr/bin/env python import random resolv_servers = ['192.168.1.1', '192.168.1.2', '192.168.1.3'] # 选出一个 print random.choice(resolv_servers) # 选出两个,做为一个列表 print random.sample(resolv_servers, 2)
Leave a Reply