On 2015-10-18 18:01, Steven D'Aprano wrote:
On Sun, Oct 18, 2015 at 08:07:07AM -0700, Alex Kleider wrote:
On 2015-10-17 19:49, Steven D'Aprano wrote:

>which will work from your package's callers, and from within the
>package
>itself provided the top level directory can be found within Python's
>path. Within the package you can also use relative imports, see the
>docs for more detail.

How does one arrange so "the top level directory _can_ be found within
Python's path."?

Thank you, Alan, Martin, Ben and Steve.
I'm a long way from distributing packages!  Rather I'm simply
writing scripts for personal use and would like to do it using
Test Driven Development- hence my wish to be able to reference
modules within my development directory.
I've been able to satisfy my needs by adding
export PYTHONPATH="${PYTHONPATH:+$PYTHONPATH:}/home/alex/Py"
to the end of my ~/.bashrc
although use of a setup.py file is probably the more 'pythonic'
way of doing it.  From my reading so far [1] it's not clear to
me exactly how this works but a bit of experimentation might
rectify that.
Again, thank you.
Alex

[1]
https://docs.python.org/3/distutils/introduction.html#distutils-simple-example


_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to