ConfigParser question

Thomas Wouters thomas at xs4all.net
Tue May 2 17:48:52 EDT 2000


On Tue, May 02, 2000 at 04:59:57PM -0400, oliver wrote:

> On Tue, 2 May 2000, oliver wrote:
> 
> > hi, 
> > 
> > here is a beginner question, I am testing out ConfigPaser module, and run
> > into error when I create the object instance, can anyone kindly point out
> > why?
> > 
> > 
> > >>> import ConfigParser
> > >>> x = ConfigParser()
> > Traceback (innermost last):
> >   File "<stdin>", line 1, in ?
> > TypeError: call of non-function (type module)

> sorry, I found the silly error, should have used "from ConfigParser import
> *".

Actually, no(*), you shouldn't have, you should just use 'from ConfigParser
import ConfigParser'. It solves a lot of your future problems if you dont
start importing anything you find on the streets. (At least, not without
some protection ;)

*) this 'no' is actually an understatement, but using the 'from ... import
*' too much will eventually make you scream 'no' in the exact right pitch
and duration, and with the right gargling, hair-pulling frustration, for
this comment ;)

-- 
Thomas Wouters <thomas at xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!




More information about the Python-list mailing list