我刚接触python,我想问一个简单的问题。
使用此代码有什么区别:
import webbrowser, pyperclip, sys
chrome = "C:/Program Files/Google/Chrome/Application/chrome.exe %s"
def location_finder():
output = input('Type the place you want to find!\n')
webbrowser.get(chrome).open('https://www.google.com/maps/place/' + output)
location_finder()
这个代码:
import webbrowser, pyperclip, sys
if len(sys.argv) > 1:
address = ' '.join(sys.argv[1:])
else:
address = pyperclip.paste()
webbrowser.open('https://www.google.com/maps/place/' + address)