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

python get ip info

import requests

# get your current public ip's info:
req = requests.get('https://utilities.tk/network/info')

# or specify an ip to check
req = requests.get('https://utilities.tk/network/info?ip=1.1.1.1')

print(req.status_code)
print(req.json())
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

how to get local ip in python

import socket
local_ip = socket.gethostbyname(socket.gethostname)
print(f"[+] Your Local IP is : {local_ip}")
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 :: get source selenium python 
Python :: python range function examples 
Python :: python http post file 
Python :: how to represent equation in pytho 
Python :: Python NumPy tile Function Syntax 
Python :: python tkinter get entry text 
Python :: three different randomn numbers python 
Python :: Discord.py - change the default help command 
Python :: python all any example 
Python :: waitkey in python 
Python :: get status code python 
Python :: how to add keyboard to python turtle 
Python :: python global keyword 
Python :: list append string 
Python :: python stack size 
Python :: how to get github repository access in python code directly 
Python :: how to add percentages to ylabel python 
Python :: plant python documentation 
Python :: python togli spazio 
Python :: fizz buzz python 
Python :: run shell script to yaml file 
Shell :: run lumen 
Shell :: check supervisord status 
Shell :: filename too long git 
Shell :: another git process seems to be running in this repository 
Shell :: git list user and email 
Shell :: bash hide command output 
Shell :: cmd clear dns cache 
Shell :: git undo commit 
Shell :: check processor in ubuntu 
ADD CONTENT
Topic
Content
Source link
Name
6+1 =