How do I use PyAutoGUI to detect a keypress event? In my research, I could not make an example in this model:
import pyautogui
num = 0
if pyautogui.press('b'): # I know the right thing is not to use the press, but, what do I put in place?
num = 1
Detecting keystrokes isn't possible in PyAutoGUI. You might want to try the Pynput module instead: https://pypi.org/project/pynput/