()
return bytes.decode(my_ip).strip()
获取本地ip
获取本地ip
获取本地ip
def get_ip():
    """
    获取本地ip
    """
    my_ip = ""
    try:
        my_ip = urllib.request.urlopen('http://api.ipify.org').read()
    except Exception:
        my_ip = urllib.request.urlopen('http://icanhazip.com').read()
    return bytes.decode(my_ip).strip()
def get_ip ( ) : my_ip = "" try : my_ip = urllib . request . urlopen ( 'http://api.ipify.org' ) . read ( ) except Exception : my_ip = urllib . request . urlopen ( 'http://icanhazip.com' ) . read ( ) return bytes . decode ( my_ip ) . strip ( )