@Wassim
Thanks.
@Stanleh
ip = socket.gethostbyname("http://google.ca")
print ip
I don't see how that contributes to the thread but I'll surely play along: putting the Python code above and your Java code side to side.. how is the Java code better?
This is a simple script I cooked up in Python in about 15 minutes to get the IP of a website. It is complete with exception handlers and bootleg loops (function calling here and there).
The purpose of this script is to retrieve the IP address of a website or hostname. It'll ask you if you wish...
Thanks.
UPDATE:
** Added the option to choose the browser of your choice. This browser must be in your PATH.
You can use the following aslong as they are in your PATH.
Using 'windows-default' will load up your favorite or default browser.
Source:
http://pastebin.com/849LBLJD...
Thanks.
UPDATE:
** Added the option to open in a new tab or in a new window (current window if availabe).
Source:
http://pastebin.com/DtbVDpKN
Snippet:
def main():
print()
print("Do not add 'http://'")
website = input("Website: ")
choice = input("Do you wish to open it in a...
I have no idea what to name this but you pretty much enter the website you want to go to (through the command line) and it will open your default browser and take you to that website.
Source:
http://pastebin.com/j5wF6Mqb
Source 2:
http://pastebin.com/DtbVDpKN
Source 3...
This is an extremely simple calculator I cooked up in Python out of boredom.
Source:
http://pastebin.com/60vUy9XW
Snippet:
def main():
choices = ['a', 's', 'm', 'd']
print("Would you like to add [A], subtract [S], multiply [M], or divide [D]?")
choice = input()
if...