Ferrous Cranus <[email protected]> writes:
> try:
> host = socket.gethostbyaddr( os.environ['REMOTE_ADDR'] )[0]
> except:
> host = "Reverse DNS Failed"
>
> Is there a way to write the above so i cna print the error return when
> it fails?
Try something like
try:
host = socket.gethostbyaddr( os.environ['REMOTE_ADDR'] )[0]
except Exception as e:
host = "Reverse DNS Failed"
print(e)
?
ciao, lele.
--
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
[email protected] | -- Fortunato Depero, 1929.
--
http://mail.python.org/mailman/listinfo/python-list