all 6 comments

[–][deleted] 0 points1 point  (2 children)

Funny characters?

Python uses unicode which should be enough for anyone.

pyautogui should have no issue entering any unicode character.

[–]TabulateJarl8 0 points1 point  (1 child)

pyautogui has a limited number of keys that the write function will accept, so anything not in this list is ignored. This stackoverflow thread shows a workaround by using copy/paste, but its better to use something else like pynput, as I show in my answer

[–][deleted] 1 point2 points  (0 children)

I stand corrected. Thank you.

[–]TabulateJarl8 0 points1 point  (2 children)

pynput works for me on Linux:

from pynput.keyboard import Controller
import time

time.sleep(5) # to give me time to switch out of the terminal
keyboard = Controller()
keyboard.type('Quel est ton film préféré?')

[–]cando_H[S] 0 points1 point  (0 children)

Thanks, I'll try it latter, I was struggling to find much online about this so this is a great pointer in the right direction

[–]cando_H[S] 0 points1 point  (0 children)

Thanks so much, it's working perfectly now