Created
May 4, 2015 07:36
-
-
Save limingzju/2cecaf2732386dc468f3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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