I have a problem, that consists in following: Pyautogui typewrite won't type letters, only numbers. For example, when I execute
pyautogui.typewrite("abc123")
only "123" appears. This question is similar to this one: Pyautogui typewrite is writing only numbers Unfortunately, there are no answers about the issue, as well as other Internet topics. I have the Windows 7 machine and Python 3.5.
There seems to be a bug in the typewrite function of PyAutoGui. I workaround it with this function which preprocesses the string into keypresses instead. Note that this version of the function leaves a comma at the end of the output array so that you can easily append more characters or button presses at the end.
def preprocess(something):
something = str(something)
output = []
for x in range(len(something)):
output.append(something[x])
output.append(',')
return output
I had the same problem couple of days ago
Try using other pyautogui functions that presses keyboard keys like pyautogui.press("k")
If you have a problem with all keyboard functions related to letters in general it's probably because your default input language is set to something other than english
you can fix that easily by going to your keyboard and input settings and changing the default input language to english
you'll still be able to write in your first language and it will hopefully solve your problem
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With