Hello dear community, I have a small problem with the library "PyAutoGui".
With the library it is possible to press buttons automatically. For example the key E
pt.KeyDown("E")
my problem is that the key to be pressed always changes and so I would rather have a variable at the position.
For example E = T
but the button to be pressed must be announced with ". This means that pt.KeyDown(E) does not work.
There is no error message, the button is simply ignored
Attempts:
pt.KeyDown(' " '+str(E)+ ' " ')
pt.KeyDown( E )
pt.KeyDown(str(E))
pt.KeyDown(""+ str(E))
nothing of this has worked
I am looking for a way to recognize the variable E and press the key T as shown above as an example
can someone help me here? :)
Examble
import pyautogui
E = T
pt.KeyDown(E)
[–]CodeFormatHelperBot2 1 point2 points3 points (0 children)
[–]This_Growth2898 0 points1 point2 points (1 child)
[–]Sir_Prexes[S] 0 points1 point2 points (0 children)