def url2ip(url):
 iport = urlsplit(url)[1].split(':')
 if (len(iport) > 1):
  return (gethostbyname(iport[0]), iport[1])
 return gethostbyname(iport[0])

def url2ip ( url ) : iport = urlsplit ( url ) [ 1 ] . split ( ':' ) if ( len ( iport ) > 1 ) : return ( gethostbyname ( iport [ 0 ] ) , iport [ 1 ] ) return gethostbyname ( iport [ 0 ] )
works like turning URL => 180 .