Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

opensource ip tracker python

import os
import urllib.request as urllib2
import json


'''An example of an IP tracker for public domain like youtube
(ip: 172.217.193.190). It can not track private ip's, 
it will return an error. The values variable, hold a returned dictionary
which can be further processed.'''

while True:
  ip = input("Input target ip:")
  url = "http://ip-api.com/json/"
  response = urllib2.urlopen (url+ip)
  data = response.read()
  values = json.loads(data)
  print(values)
  cont = input("Track another IP address? [y/n] ")
  if cont == "y" or cont == "Y":
      continue
  else:
     break
os.system("clear") 
os._exit(0)
Comment

PREVIOUS NEXT
Code Example
Python :: simple tower of hanoi project python with gui 
Python :: cast set 
Python :: geopandas cmap change options 
Python :: adjoint of 3x3 matrix in numpy 
Python :: penggunaan clear di python 
Python :: get primary key in get_context_data 
Python :: Remove Brackets from List Using the * operator with the Separator method 
Python :: python code to java code converter 
Python :: python dependency injection 
Python :: torch view vs unsqueeze 
Python :: python raw strings 
Python :: if is 
Python :: write an empty block python 
Python :: seaborn colorbar labelsize 
Python :: how do i access individual elements of matrix in python? 
Python :: 405 Method Not Allowed When Redirecting in Flask within POST route 
Python :: pandas drop zeros from series 
Python :: edgar python documentation 
Python :: python complement operator 
Python :: ring Sort List Item 
Python :: qtextedit unicode 
Python :: how to insert a character into a string in python 
Python :: void setup and void loop 
Python :: import sys execute cmd 
Python :: django date grater 
Python :: remove inner list from outer list python 
Python :: pls help i need tkintwr help plspslspslspsl help tkinter 
Python :: how to assign a value to a key dictionary in a list python 
Python :: view does not return httpresponse 
Python :: nptel swayam 
ADD CONTENT
Topic
Content
Source link
Name
6+7 =