# -*- coding: utf-8 -*-
import urllib2
import socket
url="http://droidpark.com/whatismyip/"
hostname=socket.gethostname()
lanip=socket.gethostbyname(socket.gethostname())
try:
adresiAl=urllib2.urlopen(url)
wanip=adresiAl.read()
adresiAl.close()
except IOError:
print "Şuanda ip adresiniz alamıyoruz";
wanip="Error!";
print "*"*10;
print "Makine adi : %s" % hostname
print "WAN IP Adresi : %s" % wanip
print "LAN IP Adresi : %s" % lanip
print "*"*10
Kaynak
Hiç yorum yok:
Yorum Gönder