The following script works fine: #!/bin/python
import socket str = raw_input("Enter a domain name: "); print "Your domain is ", str print socket.gethostbyname(str) You provide it a hostname, it provides an IP. That works fine. But I need a way to handle errors. For example: [root@bart /]# ./dataman.py Enter a domain name: aslfhafja Your domain is aslfhafja Traceback (most recent call last): File "./dataman.py", line 7, in <module> print socket.gethostbyname(str) socket.gaierror: [Errno -2] Name or service not known [root@bart /]# I would like to be able to handle that error a bit better. Any ideas? TIA. -- https://mail.python.org/mailman/listinfo/python-list