merely-useful / py-rse

Research Software Engineering with Python course material
http://third-bit.com/py-rse/
Other
247 stars 63 forks source link

Revisions to configuration chapter #398

Closed gvwilson closed 4 years ago

gvwilson commented 4 years ago

Ready for review.

DamienIrving commented 4 years ago

One more thought on a configuration topic that we might want to consider... at the moment we import utilities (the module we wrote) in countwords.py. That works fine if we run countwords.py from the zipf/bin directory (or a directory higher up the tree) but won't work if we execute from zipf/results or some other random directory on our system. Do we need to talk about sys.path and how we tell Python where to look for our modules?

(Or maybe it's best mentioned in Chapter 4 when we first introduce modules...?)

gvwilson commented 4 years ago

The import works on my machine: in general, import x will always find an x.py that's in the same directory as the file doing the import, even if that directory is not on PYTHON_PATH.