python3 try except 实例
import socket
try:
socket.setdefaulttimeout(2)
s=socket.socket()
s.connect(("211.144.208.7",23))
ans=s.recv(2048)
print (ans.decode("utf-8"))
except Exception as e:
print(e)
try:
print(1/0)
except (Exception) as e:
print(e)