Minimal implementation for planetary system (n-body problem) with pygame and numpy. It prints the FPS and the sum of mass*velocity once per second in your terminal. To stop drifting of the planets, an additional planet is added with a velocity vector which is the opposite of the sum of all (randomly generated) planets' velocity vectors.
For more details, see my blog post.
Create env and install requirements:
virtualenv -p python3 env
source env/bin/activate
pip install -r requirements.txt
Run it:
python planets.py