nir / jupylet

Python game programming in Jupyter notebooks.
https://jupylet.readthedocs.io
BSD 2-Clause "Simplified" License
230 stars 22 forks source link

Just a question about `sys.path.insert` in example notebooks #42

Open misolietavec opened 1 year ago

misolietavec commented 1 year ago

Why sys.path.insert(0, os.path.abspath('./..')) ?

nir commented 1 year ago

this runs the demos with the library source code that came with them, regardless of the version actually installed.

misolietavec commented 1 year ago

Why to not install that version, then? I do not see the point. But it is your choice, I respect it.

nir commented 1 year ago

the point is that if you downloaded or pulled the repository in order to run jupylet examples in it, then these examples are guaranteed to be synchronized with that code base with which they were downloaded or pulled.

misolietavec commented 1 year ago

My concern about links outside of examples is that I plan to use jupylet in educational environment with jupyterhub. I think, directory examples should be self-contained and the synchronization between jupylet installation and examples is the responsibility of system administrator. For example, link to ../docs/_static/audio/tb303.5.ogg in shadertoy_demo.py is probably not the best choice, maybe all audio samples could be moved to examples/sounds ?

nir commented 1 year ago

if you plan to use it in a stable "static" environment with a particular jupylet revision that you can control, then I think the best would be to just remove that sys.path.append(...) line since you can expect the installed revision of jupylet to match the revision of the examples folder.

I would be interested to learn more about your plan to use it in an educational environment since that was one of my hopes for the project. can you elaborate on that either in a "Discussions" thread or directly to my email nir.8bit@gmail.com