Final project for CS184 at UC Berkeley
- Python 3.7
- Pillow
python3 raytracer [args...]
- a folder with a file named
__init__.py
is considered a "module". So we have a module namedraytracer
, with 3 submodules namedrenderer
,objects
, andutils
. - to import from a file in the same module, do
from .camera import Camera
. - to import from a file within another module do
from utils.vector import Vector
orimport utils.vector [as uv]
. - the file
__init__.py
is used to define stuff accessible via a simpleimport module
. This is what allows us to dofrom utils import Vector
. - the file
__main__.py
is run when a module is "run". Which is what allows us to run the program usingpython3 raytracer
.