Skip to content

Instantly share code, notes, and snippets.

@limingzju
Created May 4, 2015 07:36
Show Gist options
  • Save limingzju/2cecaf2732386dc468f3 to your computer and use it in GitHub Desktop.
Save limingzju/2cecaf2732386dc468f3 to your computer and use it in GitHub Desktop.
import webbrowser
import os
def openWeb(url):
webbrowser.open_new_tab(url)
def main():
urls = ['http://www.baidu.com', 'http://www.bing.com', 'http://www.zhihu.com']
for url in urls:
option = raw_input('open %s Y/N: ' %url)
if not(option == 'Y' or option == 'y' or option == ''):
print 'option %s exit' %option
os.exit(1)
openWeb(url)
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment