[Tutor] write to a file

Kyle Babich kb@kb2.net
Mon, 19 Aug 2002 21:47:40 UT


On Mon, 19 Aug 2002 17:34:20 -0400, "Gus Tabares"
<gus.tabares@verizon.net> said:
> Hello,
> =09
> 	I'm trying write something to a file but I keep on getting this error:
>=20
> Traceback (most recent call last):
>   File "test.py", line 9, in ?
>     os.open("C:\blah.txt", 'w')
> TypeError: an integer is required


You probably want:
open("c:\blah.txt", "w")

Because os.open does require and integer.  If I remember right I think
it goes something like:
os.open("c:\blah.txt", 0777)


>=20
> 	I don't see what an integer has to do with anything? Thanks in advance=
...
>=20
>=20
> Gus
>=20
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>=20

--
Kyle