A simple, but cool Python simulation of the 8 planets in our solar system. This project was inspired by TechWithTim
First, clone the repository
git clone https://github.com/waternewt/planet-simulation
cd
into the directory and then run the bash script with bash run.sh
If the bash script fails, you can run it manually by cd
ing into the /src
folder and then running main.py
python script.
To get info about the arguments you can type python3 main.py --help
After you exit the pygame window, it will save a json file with the output data. If you instead want to save it into a CSV or an Excel spreadsheet, you can use the --output-type
argument. For now the only supported datatypes are json/csv/xlsx. You can use the --output-file
argument to specify the name of the file (without the extension) the data will be saved to. By default (if you don't specify the argument), the output file value will be set to output. Other datatypes may be added in the future.
There's an argument in the script called --verbosity
, this is the debug level of the simulation (aka, how much data you will be able to see). The options for verbosity (for now) are just 0, 1 and 2. Verbosity 0 will only show the planets and the orbit shape, verbosity 1 will show the month, the year, the distance from the planet to the sun, the name of the planet and a line from the planet to the center of the sun. Verbosity 2 will additionaly show the angle of the line and the total orbits (of all the planets) in the top left corner of the window.
Copyright (C) 2024 Yunus Ruzmetov
This program is free software distributed under the terms of the GNU GPL v3.
See the full license text for details.
Contact:
- Email: [email protected]
- Secondary email: [email protected]