Python Forum
How to find the pygame example files?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to find the pygame example files?
#6
im not really sure then where macs put things. I never have used or would ever use one.

I would then use python itself to tell me where it is
1) open the interpreter you want to use python 3.7 which i am assuming on a mac would be invoking it like:
python3.7
or maybe even
python37
then run sys.path to find its location
metulburr@ubuntu:~$ python3.7
Python 3.7.3 (default, Mar 26 2019, 01:59:45) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path
['', '/usr/lib/python37.zip', '/usr/lib/python3.7', '/usr/lib/python3.7/lib-dynload', '/usr/local/lib/python3.7/dist-packages', '/usr/lib/python3/dist-packages']
>>> 
That would give you the correct location of the paths for that specific python version to find the example files

In my case i would install pygame to my python3.7 via
metulburr@ubuntu:~$ python3.7 -m pip install pygame
Collecting pygame
  Downloading https://files.pythonhosted.org/packages/18/b3/0bf5afdcf6ef95d2a343cd7865585a6efe5e3e727c1a4f3385c9935248cf/pygame-1.9.6-cp37-cp37m-manylinux1_x86_64.whl (11.4MB)
    100% |████████████████████████████████| 11.4MB 153kB/s 
Installing collected packages: pygame
Successfully installed pygame
confirmation:
metulburr@ubuntu:~$ python3.7
Python 3.7.3 (default, Mar 26 2019, 01:59:45) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pygame
pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
examples execution:
metulburr@ubuntu:~$ python3.7 -m pygame.examples.aliens
pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
EDIT:
after installing mine, it installed pygame to this path in my home.
metulburr@ubuntu:~/.local/lib/python3.7/site-packages/pygame/examples$ ls
aacircle.py      fonty.py                       playmus.py
aliens.py        freetype_misc.py               prevent_display_stretching.py
arraydemo.py     glcube.py                      __pycache__
audiocapture.py  headless_no_windows_needed.py  scaletest.py
blend_fill.py    __init__.py                    scrap_clipboard.py
blit_blends.py   liquid.py                      scroll.py
camera.py        macosx                         sound_array_demos.py
chimp.py         mask.py                        sound.py
cursors.py       midi.py                        stars.py
data             moveit.py                      testsprite.py
dropevent.py     oldalien.py                    textinput.py
eventlist.py     overlay.py                     vgrade.py
fastevents.py    pixelarray.py                  video.py
Recommended Tutorials:
Reply


Messages In This Thread
How to find the pygame example files? - by Piethon - Sep-03-2019, 09:00 AM
RE: How to find the pygame example files? - by metulburr - Sep-03-2019, 01:31 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Pygame has missing files. DamonTattersfield 1 3,459 Dec-27-2019, 11:54 AM
Last Post: Windspar

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020