Newbie pythoner, with bizzare problem

Cameron Laird claird at starbase.neosoft.com
Sat Jul 22 09:48:13 EDT 2000


In article <m33dl2o39d.fsf at atrus.jesus.cam.ac.uk>,
Michael Hudson  <mwh21 at cam.ac.uk> wrote:
>milenko at moonshine.co.uk (Jack) writes:
>
>> Hey there, 
>> 
>> im pretty new to using python, and im just experimenting with file access, 
>> a wrote a script that works fine, and then all of a sudden it started 
>> throwing up this error:
>> 
>> inp = open("c:/autoexec.bat",'r')
>> TypeError: illegal argument type for built-in operation
>> 
>> it was working fine before, and i dont see anything unusual in the syntax.
>> 
>> Any help would be appreciated,
>
>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')
-- 

Cameron Laird <claird at NeoSoft.com>
Business:  http://www.Phaseit.net
Personal:  http://starbase.neosoft.com/~claird/home.html



More information about the Python-list mailing list