Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

get IP address python

import socket    
hostname = socket.gethostname()    
IPAddr = socket.gethostbyname(hostname)    
print("Your Computer Name is:" + hostname)    
print("Your Computer IP Address is:" + IPAddr) 
#How to get the IP address of a client using socket
Comment

get ip address py

import requests

# Prints public IPv4 address:
print(requests.get('https://utilities.tk/network/info').json()['ip'])

# Prints more info like location, hostname etc
print(requests.get('https://utilities.tk/network/info').json())
Comment

get ip address python

import socket
socket.gethostbyname(socket.gethostname())
Comment

get ip python

import re

f = open('C:/Users/Admin/Downloads/iplogs.txt', 'r') #Text file with many ip address
o = f.read()
ip1 = re.findall( r"d{1,3}.d{1,3}.d{1,3}.d{1,3}", o )
hosts = ip1
for host in hosts:
                    print(host)
Comment

PREVIOUS NEXT
Code Example
Python :: python convert list to true falsebased on condition 
Python :: ImportError: dynamic module does not define module export function (PyInit_cv_bridge_boost) 
Python :: continue reading lines until there is no more input python 
Python :: split data validation python 
Python :: scrapy get current url 
Python :: use incognito mode in selenium webdriver 
Python :: python flask access-control-allow-origin 
Python :: python upload video to youtube 
Python :: Remove duplicates with pandas 
Python :: copy whole directory python 
Python :: change specific column name pandas 
Python :: selenium full screen python 
Python :: python apply a function to a list inplace 
Python :: how to take array input in python in single line 
Python :: save plot as pdf python 
Python :: get the torch version 
Python :: export file csv 
Python :: blender python set object to active by name 
Python :: how to take list of integer as input in python 
Python :: python rotate pdf pages 
Python :: clear screen python 
Python :: python setter getter deleter 
Python :: change column order dataframe python 
Python :: python make txt file 
Python :: python program to keep your computer awake 
Python :: python numpy installation 
Python :: install pipenv on windows 
Python :: Generate random image np array 
Python :: how to read tsv file python 
Python :: install python glob module in windows 
ADD CONTENT
Topic
Content
Source link
Name
5+1 =