Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pyautogui cannot write the @ symbol

I've been trying to produce the "@" character with pyautogui:

import pyautogui
pyautogui.typewrite("@")
pyautogui.typewrite("\x40")

But I can't seem to make it type a "@" in any way.

My keyboard uses AltGr + 2 to create an "@" symbol, but I haven't been able to make that work either.

like image 927
Japyao Avatar asked Oct 25 '25 00:10

Japyao


2 Answers

I did not find a way to do it with the write method, but in some scenarios you could work around it by putting the @ on the clipboard and paste it:

import pyperclip
pyperclip.copy('@')
pyautogui.hotkey('ctrl', 'v')
like image 109
trincot Avatar answered Oct 27 '25 01:10

trincot


pyautogui.hotkey('altright','2')
like image 44
Japyao Avatar answered Oct 26 '25 23:10

Japyao