bal_gennady

Открывает карту в браузере

Aug 16th, 2020
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | None | 0 0
  1. # Открывает карту в браузере, извлекая адрес
  2. # из командной строки или буфера обмена
  3.  
  4. import webbrowser, sys, pyperclip
  5. from urllib import parse
  6.  
  7. if len(sys.argv) > 1:
  8.     address = ' '.join(sys.argv[1:])
  9. else:
  10.     address = pyperclip.paste()
  11.  
  12. address = parse.urlencode({'text': address})
  13. webbrowser.open('https://yandex.ru/maps/?' + address)
Add Comment
Please, Sign In to add comment