title: Change keyboard layout on mac terminal
body: <p>I'm on macOS Sierra and I would like to know how to change my keyboard layout from the command line, so I can automate tasks  with python using PyAutoGui. </p>
  
  <p>Is there a specific command or do I need a script? I'm using a Qwertz Swiss keyboard. So a simple example of my problem is that if I don't change my keyboard to Qwerty manually, I get <strong>mz</strong> and not <strong>my</strong>.</p>