<jupyter_start><jupyter_text>"""      http://www.trex-game.skipser.com/"""<jupyter_code>#top,left,width,height are set according to where the program see necessary part of screen.
mon = {"top":473, "left":817, "width":280, "height":100}
sct = mss()

i = 0

def record_screen(record_id, key):
    global i
    i+=1
    print(f'{key}: {i}')
    
    img = sct.grab(mon)
    im = Image.frombytes("RGB",img.size,img.rgb)
    im.save(f'./trackresimleri/{key}_{record_id}_{i}.png')
    
is_exit = False

def exit():
    global is_exit
    is_exit = True
    
keyboard.add_hotkey("esc",exit)

record_id = uuid.uuid4()

while True:
    if is_exit:
        break
    
    try:
        if keyboard.is_pressed(keyboard.KEY_UP):
            record_screen(record_id,"up")
            time.sleep(0.1)
        elif keyboard.is_pressed(keyboard.KEY_DOWN):
            record_screen(record_id,"down")
            time.sleep(0.1)
        elif keyboard.is_pressed("right"):
            record_screen(record_id,"right")
            time.sleep(0.1)
    except RuntimeError:
        continue<jupyter_output>right: 1
right: 2
right: 3
right: 4
right: 5
right: 6
right: 7
right: 8
up: 9
up: 10
up: 11
up: 12
up: 13
up: 14
up: 15
up: 16
up: 17
up: 18
up: 19
up: 20
up: 21
up: 22
up: 23
up: 24
up: 25
up: 26
up: 27
up: 28
up: 29
up: 30
up: 31
up: 32
up: 33
up: 34
right: 35
right: 36
right: 37
right: 38
right: 39
right: 40
right: 41
right: 42
right: 43
up: 44
up: 45
up: 46
up: 47
up: 48
up: 49
up: 50
up: 51
up: 52
right: 53
right: 54
up: 55
up: 56
right: 57
right: 58
right: 59
up: 60
up: 61
up: 62
up: 63
up: 64
up: 65
up: 66
right: 67
right: 68
right: 69
right: 70
up: 71
up: 72
up: 73
up: 74
up: 75
up: 76
up: 77
right: 78
right: 79
right: 80
right: 81
right: 82
right: 83
up: 84
up: 85
up: 86
up: 87
up: 88
up: 89
up: 90
up: 91
up: 92
up: 93
right: 94
right: 95
up: 96
up: 97
up: 98
up: 99
up: 100
up: 101
up: 102
right: 103
right: 104
right: 105
up: 106
up: 107
up: 108
right: 109
right: 110
up: 111
up: 112
up: 113
up: 114
up: 115
right: 116
right: 117
right: 118
right: 119
up: 120
up: 121
right: 122
[...]
{'fraction_non_alphanumeric': 0.13492822966507176, 'fraction_numerical': 0.1334928229665072, 'mean_word_length': 2.8794063079777366, 'pattern_counts': {'":': 4, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '259092', 'license': 'MIT', 'n_tokens_mistral': 1147, 'n_tokens_neox': 880, 'n_words': 311, 'path': 'CNN(/Trex Project/Data Collecting Part/Trex Project 1 - Data Collecting Part.ipynb', 'repo_name': 'AkifCanSonmez/ImageProccessingCourse', 'size': '2090'}