import keyboard  
from PIL import Image, ImageGrab

while True: 
    try:  
        if keyboard.is_pressed('q'):  
            print('You Pressed A Key!')
            img = ImageGrab.grab()

            img.save("test.png", "PNG")
            img.show()
            break  
        else:
            pass
    except:
        break  
38a83135da448f5b3ca8756369bc509937c79334
<mask token>

<mask token>
while True:
    try:
        if keyboard.is_pressed('q'):
            print('You Pressed A Key!')
            img = ImageGrab.grab()
            img.save('test.png', 'PNG')
            img.show()
            break
        else:
            pass
    except:
        break

import keyboard
from PIL import Image, ImageGrab
while True:
    try:
        if keyboard.is_pressed('q'):
            print('You Pressed A Key!')
            img = ImageGrab.grab()
            img.save('test.png', 'PNG')
            img.show()
            break
        else:
            pass
    except:
        break

import keyboard  
from PIL import Image, ImageGrab

while True: 
    try:  
        if keyboard.is_pressed('q'):  
            print('You Pressed A Key!')
            img = ImageGrab.grab()

            img.save("test.png", "PNG")
            img.show()
            break  
        else:
            pass
    except:
        break  