Newbie pythoner, with bizzare problem

Gordon McMillan gmcm at hypernet.com
Sat Jul 22 11:30:12 EDT 2000


Cameron Laird wrote: 

>Michael Hudson wrote:

>>5 gets you 7 that you have added a 
>>
>>from os import *
>>
>>to your script.
>>
>>Don't do that.

>I'd be willing to raise the odds on that bet.
>
>You're also right that
>  from os import *
>is, of course, universally deprecated.
>
>What surprises me, though, is that no one ever
>mentions the possibility of writing
>  inp = __builtin__.open("c:/autoexec.bat",'r')

Because __builtin__ is a module and has to be imported. And someone who 
says 

from os import *

would also say

from __buitin__ import *

And we'd be back where we started.

-Gordon



More information about the Python-list mailing list