$ python3 --version ⏎2. pip で pygame をインストール
Python 3.6.8 
$ su ⏎3. pygame のバージョンと格納ディレクトリを確認
# python3 -m pip install pygame ⏎
# exit ⏎
$ python3 -c "import pygame; print(pygame.__file__)" ⏎4. pygame のサンプルプログラムを確認
※太字部分が pygame の格納ディレクトリ。
※注意: 実際の表示は太字になりません。
$ ls -l /usr/local/lib64/python3.6/site-packages/pygame/examples/ ⏎5. pygame のサンプルプログラムを実行
(上記 3 で確認した格納ディレクトリ + "examples/" を指定する)
pygame のサンプルプログラム (プログラム) は、必ず GUI 画面から実行すること。
GUI 画面ではないテキストターミナルから実行した例: (失敗例)上記 4 のサンプルプログラムの中から eventlist.py を実行する。
※ video system (グラフィック画面) が使えないというエラーで終了している
pygame 2.0.0 (SDL 2.0.12, python 3.6.8) Hello from the pygame community. https://www.pygame.org/contribute.html Traceback (most recent call last): File "/usr/lib64/python3.6/runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "/usr/lib64/python3.6/runpy.py", line 85, in _run_code exec(code, run_globals) File "/usr/local/lib64/python3.6/site-packages/pygame/examples/aliens.py", line 410, inmain() File "/usr/local/lib64/python3.6/site-packages/pygame/examples/aliens.py", line 252, in main bestdepth = pg.display.mode_ok(SCREENRECT.size, winstyle, 32) pygame.error: video system not initialized 
$ python3 -m pygame.examples.eventlist ⏎
この実行画面でマウスを動かしたり、キーを押したりすると「Status Area」中の文字が変化し、
その時何が起きているか「Event History Area」に表示される。