Re: [Tutor] Import from project's lib directory?

2014-08-29 Thread leam hall
On Thu, Aug 28, 2014 at 6:39 PM, Cameron Simpson c...@zip.com.au wrote: On 28Aug2014 22:36, Alan Gauld alan.ga...@btinternet.com wrote: On 28/08/14 19:03, leam hall wrote: python 2.4.3 on Red Hat Linux. I'm starting a project and want to break the scripts into input, output, and ddl. I'd

Re: [Tutor] Import from project's lib directory?

2014-08-29 Thread leam hall
On Fri, Aug 29, 2014 at 9:39 AM, diliup gabadamudalige dili...@gmail.com wrote: this is the easiest way to do this # one.py is in the \data\ directory # two.py is in the \data\img\ directory # three.py is in the \data\img\sc\ directory ## this program is in the learn_music dir ##

Re: [Tutor] Import from project's lib directory?

2014-08-29 Thread leam hall
Am I asking the wrong question? How do older apps with older versions of python (2.4.x) separate code into sub-directories? Do they? -- Mind on a Mission ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options:

Re: [Tutor] Import from project's lib directory?

2014-08-29 Thread Peter Otten
leam hall wrote: Am I asking the wrong question? How do older apps with older versions of python (2.4.x) separate code into sub-directories? Do they? Even new versions allow relative imports only inside packages. Given a tree $ tree . ├── alpha │ ├── beta │ │ ├── __init__.py │ │ └──

Re: [Tutor] Import from project's lib directory?

2014-08-29 Thread leam hall
On Fri, Aug 29, 2014 at 5:16 PM, Peter Otten __pete...@web.de wrote: leam hall wrote: Am I asking the wrong question? How do older apps with older versions of python (2.4.x) separate code into sub-directories? Do they? You have to ensure that the *parent* of alpha is in sys.path. Then you

[Tutor] Import from project's lib directory?

2014-08-28 Thread leam hall
python 2.4.3 on Red Hat Linux. I'm starting a project and want to break the scripts into input, output, and ddl. I'd like to have a lib library directory for local modules. The library directory would be at the same level as the others. How do I get the library modules? import

Re: [Tutor] Import from project's lib directory?

2014-08-28 Thread Danny Yoo
On Thu, Aug 28, 2014 at 11:03 AM, leam hall leamh...@gmail.com wrote: python 2.4.3 on Red Hat Linux. I'm starting a project and want to break the scripts into input, output, and ddl. I'd like to have a lib library directory for local modules. The library directory would be at the same level

Re: [Tutor] Import from project's lib directory?

2014-08-28 Thread leam hall
On Thu, Aug 28, 2014 at 2:19 PM, Danny Yoo d...@hashcollision.org wrote: On Thu, Aug 28, 2014 at 11:03 AM, leam hall leamh...@gmail.com wrote: python 2.4.3 on Red Hat Linux. I'm starting a project and want to break the scripts into input, output, and ddl. I'd like to have a lib library

Re: [Tutor] Import from project's lib directory?

2014-08-28 Thread Danny Yoo
Fails on both Python 2.4 and 2.6 with either .lib or ..lib. ### code #!/usr/bin/env python from ..lib import mymodule In python/ddl, referencing ../lib/mymodule.py ./import_test.py Traceback (most recent call last): File ./import_test.py, line 3, in module from .lib

Re: [Tutor] Import from project's lib directory?

2014-08-28 Thread leam hall
On Thu, Aug 28, 2014 at 3:27 PM, Danny Yoo d...@hashcollision.org wrote: Fails on both Python 2.4 and 2.6 with either .lib or ..lib. ### code #!/usr/bin/env python from ..lib import mymodule In python/ddl, referencing ../lib/mymodule.py ./import_test.py Traceback (most recent

Re: [Tutor] Import from project's lib directory?

2014-08-28 Thread Alan Gauld
On 28/08/14 19:03, leam hall wrote: python 2.4.3 on Red Hat Linux. I'm starting a project and want to break the scripts into input, output, and ddl. I'd like to have a lib library directory for local modules. The library directory would be at the same level as the others. How do I get the

Re: [Tutor] Import from project's lib directory?

2014-08-28 Thread Cameron Simpson
On 28Aug2014 22:36, Alan Gauld alan.ga...@btinternet.com wrote: On 28/08/14 19:03, leam hall wrote: python 2.4.3 on Red Hat Linux. I'm starting a project and want to break the scripts into input, output, and ddl. I'd like to have a lib library directory for local modules. The library directory