Re: PYTHONPATH and module names

2013-07-02 Thread SpaghettiToastBook .
Relative imports only work with the "from ... import ..." form. — SpaghettiToastBook On Mon, Jul 1, 2013 at 3:54 PM, Tobiah wrote: >> Are you familiar with absolute and relative imports: >> http://docs.python.org/release/2.5/whatsnew/pep-328.html > > > Doesn't seem to work: > > Python 2.7.3 (de

Re: PYTHONPATH and module names

2013-07-01 Thread Lele Gaifax
Steven D'Aprano writes: > On Mon, 01 Jul 2013 14:38:50 -0700, rusi wrote: >> 2. The __future__ is not necessary in python 2.7 [Not necessary or not >> allowed I not know :-) ] > > Not necessary. IIRC that it is needed, to solve the OP problem: one thing is the syntax, which under Python 2.7 is e

Re: PYTHONPATH and module names

2013-07-01 Thread Fábio Santos
On 1 Jul 2013 20:58, "Tobiah" wrote: >> >> Are you familiar with absolute and relative imports: >> http://docs.python.org/release/2.5/whatsnew/pep-328.html > > > Doesn't seem to work: > > Python 2.7.3 (default, May 10 2012, 13:31:18) > [GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu4)] on linux2 > Type "help", "

Re: PYTHONPATH and module names

2013-07-01 Thread Steven D'Aprano
On Mon, 01 Jul 2013 14:38:50 -0700, rusi wrote: > On Tuesday, July 2, 2013 1:24:30 AM UTC+5:30, Tobiah wrote: >> > Are you familiar with absolute and relative imports: >> > http://docs.python.org/release/2.5/whatsnew/pep-328.html >> >> Doesn't seem to work: >> Python 2.7.3 (default, May 10 2012,

Re: PYTHONPATH and module names

2013-07-01 Thread rusi
On Tuesday, July 2, 2013 1:24:30 AM UTC+5:30, Tobiah wrote: > > Are you familiar with absolute and relative imports: > > http://docs.python.org/release/2.5/whatsnew/pep-328.html > > Doesn't seem to work: > Python 2.7.3 (default, May 10 2012, 13:31:18) > [GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu4)] on linux

Re: PYTHONPATH and module names

2013-07-01 Thread Tobiah
Are you familiar with absolute and relative imports: http://docs.python.org/release/2.5/whatsnew/pep-328.html Doesn't seem to work: Python 2.7.3 (default, May 10 2012, 13:31:18) [GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu4)] on linux2 Type "help", "copyright", "credits" or "license" for more information.

Re: PYTHONPATH and module names

2013-07-01 Thread rusi
On Monday, July 1, 2013 11:59:35 PM UTC+5:30, Tobiah wrote: > So today, I created a file called 'formatter.py', > and my program broke. It turned out that I was > also import 'gluon' from web2py, which in turn, > somewhere, imported the regular python formatter.py > with which I was not familiar.

PYTHONPATH and module names

2013-07-01 Thread Tobiah
So today, I created a file called 'formatter.py', and my program broke. It turned out that I was also import 'gluon' from web2py, which in turn, somewhere, imported the regular python formatter.py with which I was not familiar. So the question is: Does one simply always have to be knowledgeable