Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python get lan ip

import socket
def get_ip():
    s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
    try:
        # doesn't even have to be reachable
        s.connect(('10.255.255.255', 1))
        IP = s.getsockname()[0]
    except Exception:
        IP = '127.0.0.1'
    finally:
        s.close()
    return IP
Comment

PREVIOUS NEXT
Code Example
Python :: limpiar consola en python 
Python :: how to check the type of a variable in python 
Python :: what is my python working directory 
Python :: reset a turtle python 
Python :: remove blank spaces from a list python 
Python :: sample randomforest hyperparameter tuning 
Python :: generate random list of number py 
Python :: get last element of array python 
Python :: how to read files in python 
Python :: creat and active python environment 
Python :: python requests cookies 
Python :: add background image in django uploaded file 
Python :: pandas inner join on two columns 
Python :: convert mb to gb python 
Python :: shutil copy folder 
Python :: get columns that contain null values pandas 
Python :: create a list of characters python 
Python :: python turtle background image 
Python :: convert array to list python 
Python :: find first date python 
Python :: python create virtualenv 
Python :: pandas to excel add another sheet in existing excel file 
Python :: how to add value to to interger in python 
Python :: python print user input 
Python :: set cookie in python requests 
Python :: how to import pygame 
Python :: how to encrypt a string python 
Python :: word pattern python 
Python :: create python file kali linux 
Python :: convert image to black and white python 
ADD CONTENT
Topic
Content
Source link
Name
6+4 =