[Tutor] file open error

John Fouhy john at fouhy.net
Fri Feb 9 00:33:14 CET 2007


On 09/02/07, Jalil <jalilsan at gmail.com> wrote:

Hi Jalil,

Because you're doing this:

> from os import *

It means that when you get to this line:

> fh=open(filename)

You're actually calling os.open, which is lower-level than the
standard open() and expects different arguments.

Many people recommend not doing "from .. import *" if you can possibly
avoid it because of this precise problem!

-- 
John.


More information about the Tutor mailing list