[Tutor] write to a file
Rick Pasotto
rickp@telocity.com
Mon, 19 Aug 2002 17:44:36 -0400
On Mon, Aug 19, 2002 at 05:34:20PM -0400, Gus Tabares wrote:
> Hello,
>
> I'm trying write something to a file but I keep on getting this error:
>
> Traceback (most recent call last):
> File "test.py", line 9, in ?
> os.open("C:\blah.txt", 'w')
> TypeError: an integer is required
>
> I don't see what an integer has to do with anything? Thanks in advance...
Forget the 'os.' just use open("C:blah.txt",'w').
os.open() returns a file *descriptor* and is different from the builtin
open() which returns a file *object* and takes different parameters.
--
"Happiness is the interval between periods of unhappiness."
-- Don Marquis
Rick Pasotto rickp@telocity.com http://www.niof.net