#🔒 Pyautogui cant make |

9 messages · Page 1 of 1 (latest)

young ibex
#

I'm trying to write something but pyautogui cant write the pipe letter (|)
I'm using a DE layout on my keyboard

abstract vortexBOT
#

@young ibex

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

dreamy mountain
# young ibex I'm trying to write something but pyautogui cant write the pipe letter (|) I'm u...

Looks like pyautogui hasn't figured out how to handle other non-english keyboards yet Roadmap: Non-English Keyboards #137
From that issue comes a workaround, which is to use the keyboard module for writing text instead link

Well, there is a simple solution workaround for this bug:

import pyautogui
import keyboard

pyautogui.write('Test #1: äöüß ÄÖÜ !§$%&/()=?\ <>+-*~_;:|')
pyautogui.write("\n")

keyboard.write('Test #2: äöüß ÄÖÜ !§$%&/()=?\ <>+-*~_;:|')

Output:

Test '1:   !$%&/()=?\ >>*-*_;:
Test #2: äöüß ÄÖÜ !§$%&/()=?\ <>+-*~_;:|

✔ Testet on a german Windows 10, Python 3.10.5, PyAutoGUI 0.9.53, keyboard 0.13.5

Link to the keyboard package: https://pypi.org/project/keyboard/

young ibex
#

@dreamy mountain works perfectly fine thanks, in germany we say ''bester Mann''

dreamy mountain
#

👍 No problem. If all is good, !close to close this post.

young ibex
#

!close

abstract vortexBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.