Re: file descriptors fdopen

2004-12-06 Thread Jeremy Jones
Scott Frankel wrote:
Why does os.fdopen('foo.txt', 'w') require an integer?
Ultimately, I want to create a new file on disk.
Funny, I can't seem to suss-out how to create a new file without 
resorting
to os.system('touch foo.txt').  ... Or maybe not so funny ...

 foo = os.fdopen('foo.txt', 'w')
Traceback (most recent call last):
  File stdin, line 1, in ?
TypeError: an integer is required
Thanks in advance!
Scott

If you just want to create a file for writing to, you probably want:
foo = open('foo.txt', 'w')
Jeremy Jones
--
http://mail.python.org/mailman/listinfo/python-list


Re: file descriptors fdopen

2004-12-06 Thread Scott Frankel
foo = open('foo.txt', 'w')
duh.
Thanks -
Scott
On Dec 6, 2004, at 11:27 AM, Scott Frankel wrote:
Why does os.fdopen('foo.txt', 'w') require an integer?
Ultimately, I want to create a new file on disk.
Funny, I can't seem to suss-out how to create a new file without 
resorting
to os.system('touch foo.txt').  ... Or maybe not so funny ...

 foo = os.fdopen('foo.txt', 'w')
Traceback (most recent call last):
  File stdin, line 1, in ?
TypeError: an integer is required
Thanks in advance!
Scott

--
http://mail.python.org/mailman/listinfo/python-list
--
http://mail.python.org/mailman/listinfo/python-list