📅  最后修改于: 2022-03-11 14:45:08.314000             🧑  作者: Mango
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()