小园的景色,比想象的绿,绿色世界里溢出的那股泥土味,流过背着阳光的小土丘,一大片嫩绿涌入眼底,一粒粒草叶上滑落的雨滴,一朵朵淡黄的小花含着笑将露滴入另一处世界。
本文实例讲述了Python实现的简单dns查询功能。分享给大家供大家参考,具体如下:
#!/usr/bin/python import sys,socket def print_array(*arr): array = arr for item in array: print item[4][0] print '''this script is for host resolve print "now this begin... if you want to leave,please input "break"''' while 1: try: host = raw_input("please input the host: ") except KeyboardInterrupt: print "\n", continue except : print "\n", continue if host == "break" or host == "": break result = socket.getaddrinfo(host,None,0,socket.SOCK_STREAM) print_array(*result)
希望本文所述对大家Python程序设计有所帮助。
到此这篇关于Python实现的简单dns查询功能示例就介绍到这了。自己要先看得起自己,别人才会看得起你。更多相关Python实现的简单dns查询功能示例内容请查看相关栏目,小编编辑不易,再次感谢大家的支持!