newbie question:

Alan Gauld alan.gauld at gssec.bt.co.uk
Tue Aug 8 08:41:37 EDT 2000


Azratax wrote:
>       i have made a simple module with a function (init() )  that opens a file
> to an object. I imported this module and ran init() . Thought i get no error,
> the fileobject is nowhere to be found. 

First, although you defined init() are you sure you ran it?
ie by calling modname.init()?

Second, init() ties to open an existing file(default mode 
is read(r)). So unless the file existed already Python won't 
open it. But that should raise an IOError...


> i have tried a dir() through every
> module yet cant find any object with that name... 

Err, Which name? Which object? You haven't created 
any objects in your module...

Alan G.
-- 
=================================================
This post represents the views of the author 
and does not necessarily accurately represent 
the views of BT.



More information about the Python-list mailing list