Re: [Tutor] Best way to get root project directory in module search path

2017-08-28 Thread Cameron Simpson
On 28Aug2017 20:39, boB Stepp wrote: On Sun, Aug 27, 2017 at 6:03 PM, Cameron Simpson wrote: from os.path import dirname It did not occur to me to import something from os.path to use sys.path! It is pretty normal to import specific names from modules rather than laboriously writing things

Re: [Tutor] Best way to get root project directory in module search path

2017-08-28 Thread boB Stepp
On Sun, Aug 27, 2017 at 6:03 PM, Cameron Simpson wrote: > On 27Aug2017 14:27, boB Stepp wrote: >> >> On Sun, Aug 27, 2017 at 2:13 AM, Cameron Simpson wrote: >>> >>> On 26Aug2017 21:27, boB Stepp wrote: >>> The trouble with this specific approach is that '..' relies on your >>> _working_ direct

Re: [Tutor] Best way to get root project directory in module search path

2017-08-27 Thread Cameron Simpson
On 27Aug2017 14:27, boB Stepp wrote: On Sun, Aug 27, 2017 at 2:13 AM, Cameron Simpson wrote: On 26Aug2017 21:27, boB Stepp wrote: import sys sys.path.append('..') [...] The trouble with this specific approach is that '..' relies on your _working_ directory being above ScriptMenuSystem i.e.

Re: [Tutor] Best way to get root project directory in module search path

2017-08-27 Thread boB Stepp
On Sun, Aug 27, 2017 at 2:13 AM, Cameron Simpson wrote: > On 26Aug2017 21:27, boB Stepp wrote: >> >> I have a project structure where I am developing various programs, >> some in Pinnacle HotScript language, some in Perl, some in Python, >> some shell scripts. For the purpose of this question, m

Re: [Tutor] Best way to get root project directory in module search path

2017-08-27 Thread Cameron Simpson
On 26Aug2017 21:27, boB Stepp wrote: I have a project structure where I am developing various programs, some in Pinnacle HotScript language, some in Perl, some in Python, some shell scripts. For the purpose of this question, my simplified development file structure is: ~/_dev_Scripts /Scrip

[Tutor] Best way to get root project directory in module search path

2017-08-26 Thread boB Stepp
SunOS 5.10, Python 2.4/2.6. Again, please forgive any typos as I am having to manually enter everything. I must confess that even though I've asked about similar topics in the past, I still don't think I'm fully "getting it". I have a project structure where I am developing various programs, som