import webbrowser
url = 'http://www.stackoverflow.com'
url2 = 'http://www.stackexchange.com'
def main():
webbrowser.open(url2) # To open new window
print('Opening Stack Exchange website!')
webbrowser.open_new_tab(url) # To open in new tab
print('Opening Stack Overflow website in a new tab!')
if __name__ == '__main__':
main()