this is really simple Python, but still its good to share code.
This can be very usefull if you like to hit sites ect.
the following code is for Python v2.7.3
the output would be googles IP address.
now, with the knowledge of the code above, you can easily upgrade the code.
Here is an example:
so with that script, you can easily type the name of the site & resolve it. Very useful.
There are many things you can do with the module socket, but ill leave that up to you.
I hope you may benefit from this.
This can be very usefull if you like to hit sites ect.
the following code is for Python v2.7.3
Code
import socket
print socket.gethostbyname("google.com")the output would be googles IP address.
now, with the knowledge of the code above, you can easily upgrade the code.
Here is an example:
Code
import socket, pyperclip, time
site = raw_input("\n Website: ")
print("\n {#} Resolving IP Address for %s... {#}" % (site))
time.sleep(1)
print("\n {#} IP Address = %s" % socket.gethostbyname(site))
time.sleep(1)
print("\n {#} Copying IP Address To Clipboard...")
pyperclip.copy(socket.gethostbyname(site))
spam = pyperclip.paste()
print("\n {#} IP Address Copied To Clipboard!")so with that script, you can easily type the name of the site & resolve it. Very useful.
There are many things you can do with the module socket, but ill leave that up to you.
I hope you may benefit from this.
