-
Notifications
You must be signed in to change notification settings - Fork 11
/
getip.py
46 lines (31 loc) · 1.12 KB
/
getip.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import socket
from django.core.validators import URLValidator
from django.core.exceptions import ValidationError
logo = '''
____ _ _ ___
( __) ( ) ((())) ( )
| | _ ___ | _) | | | O |
( )_))( o_)( ) ( ) ( __/
/____\ \( /_\ /_\ /_\
code from R3DHULK
******************************************
* *
* coded simple python script *
* to know about url's ip *
* and validity *
* *
******************************************
'''
print (logo)
hostname = socket.gethostname()
myip = socket.gethostbyname(hostname)
print ( " You are working on " + hostname)
print (" Your IP is " + myip)
url = URLValidator()
try:
url = input ("Enter Url to get it's IP : ")
print("It is a valid URL")
print("The IP for this " + url + " is ", socket.gethostbyname(url))
except ValidationError as exception:
print("It is not a valid URL")
input("Enter To Exit")