0

I working with pyautogui module and performed following steps:

  1. imported pyautogui.
  2. gave pyautogui.hotkey('winleft')

Worked properly and window popped up. Now I want to launch chrome.

  1. Gave command pyautogui.typewrite('chrome\n')

Instead of launching chrome , it is typing on IDLE panel as chrome.

Kindly help how to resolve this Because I want to launch chrome.

OS: windows 10
Python version: 3.8.1

help-info.de
  • 6,695
  • 16
  • 39
  • 41
Iltu
  • 1

1 Answers1

0
import webbrowser

url = 'about:blank'

# MacOS
#chrome_path = 'open -a /Applications/Google\ Chrome.app %s'

# Windows
chrome_path = 'C:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s'

# Linux
# chrome_path = '/usr/bin/google-chrome %s'

webbrowser.get(chrome_path).open(url)