Change keyboard layout with python?
问题 I'm working on a college system (windows XP) and want to set the keyboard to Dvorak when I log on. I currently have a python script that changes the desktop image. Can I use python to change the layout as well? Or are there other ways? 回答1: to Change keyboard layout import win32api win32api.LoadKeyboardLayout('00000409',1) # to switch to english win32api.LoadKeyboardLayout('00000401',1) # to switch to arabic and for Dvorak : win32api.LoadKeyboardLayout("00010409",1) or win32api