#i am vivek kumar
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
This prpgramme find your global ip addresh
No comments:
Post a Comment