Simple Python Program to Show Global IP address

global-ip
Simple Python Program to Show Global IP address

 

# created by kumar shubham
# http://hackaholic.info, http://hackaholic.co.in
# www.youtube.com/juniourkawasakicool
# www.facebook.com/hackaholic.info
import urllib2
import re
import Tkinter
import socket
import tkMessageBox
try:
    k=urllib2.urlopen("http://hackaholic.info/ip.php")
    k=k.read()
    ip=re.findall('\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}',k)
except:
    tkMessageBox.showerror('Internet','no internet connection')
main=Tkinter.Tk()
main.minsize(200,60)
main.title("Global IP")
frametop=Tkinter.Frame(main)
framemid=Tkinter.Frame(main)
framebot=Tkinter.Frame(main)
frametop.pack()
framemid.pack()
framebot.pack()
host="Welcome " + socket.gethostname()
label1=Tkinter.Label(frametop,text=host)
label1.pack()
gip="Global IP: " + ip[0]
label2=Tkinter.Label(framemid,text=gip)
label2.pack()
b=Tkinter.Button(framebot,text="Ok",bg='green',command=main.destroy)
b.pack()
main.mainloop()

Save the above python Programe as ‘global.py’. Open terminal(linux) or cmd(windows) and then type:
python global.py

Plz Share Share on FacebookShare on Google+Share on LinkedInTweet about this on TwitterEmail this to someoneShare on RedditShare on TumblrDigg thisBuffer this pagePrint this pagePin on PinterestShare on StumbleUponFlattr the author
Bookmark the permalink.

2 Comments

  1. sir please check your mail i have sent you 1 mail for your help… razeen.m5@rediffmail.com

  2. thank you skype at add me
    skype: Norsinli13

Leave a Reply

Your email address will not be published. Required fields are marked *