控制台输入参数实例
#! python3 # mapIt.py - Launches a map in the browser using an address from the # command line or clipboard. import webbrowser, sys, pyperclip #如果命令输入了参数,就从命令里得到地名 if len(sys.argv) > 1: # Get address from command line. address = ' '.join(sys.argv[1:]) else: # 否则从粘贴板得地名Get address from clipboard. address = pyperclip.paste() webbrowser.open('https://www.google.com/maps/place/' + address)