Re: os.tmpfile() vs. tempfile.TemporaryFile()

2010-11-12 Thread Carl Banks
On Nov 11, 10:32 am, John Nagle wrote: >    Is there any reason to prefer "tempfile.TemporaryFile()" > over "os.tmpfile()"?  Both create a nameless temporary file > that will be deleted on close. os.tmpfile calls your OS's tmpfile system call. tempfile.TemporaryFile creates the temporary file its

Re: os.tmpfile() vs. tempfile.TemporaryFile()

2010-11-11 Thread danmcle...@yahoo.com
On Nov 11, 11:32 am, John Nagle wrote: >    Is there any reason to prefer "tempfile.TemporaryFile()" > over "os.tmpfile()"?  Both create a nameless temporary file > that will be deleted on close. > >                                 John Nagle tempfile.TemporaryFile has more options, e.g. file pre

Re: os.tmpfile()

2008-01-02 Thread Erik Max Francis
[EMAIL PROTECTED] wrote: > Erik, I am going to be displaying sections of text in the Terminal Window on > OS X. > I wanted to format the text in a specific way and thought it might be quicker > to > output all the text to a temporary file that I could quickly read sections > from instead >

RE: os.tmpfile()

2008-01-02 Thread jyoung79
> It's a file. You read strings from it and write strings to it. It > isn't a string itself. Given that what you're trying to do doesn't make > any sense, it's hard to know where to begin to identify what's confusing > you. > -- > Erik Max Francis Erik, I am going to be displaying sections

Re: os.tmpfile()

2008-01-02 Thread Christian Heimes
[EMAIL PROTECTED] wrote: > Can anyone elaborate on how 'os.tmpfile()' works? I was thinking it would > create some sort of temporary file I could quickly add text too and then when > I was finished would automatically get rid of it. Here's my questions: Please don't use os.tmpfile(). It's not

Re: os.tmpfile()

2008-01-01 Thread redawgts
Try this: >>> import os >>> c = os.tmpfile() >>> c.write('dude') >>> c.seek(0) >>> c.read() 'dude' -- http://mail.python.org/mailman/listinfo/python-list

Re: os.tmpfile()

2008-01-01 Thread Erik Max Francis
[EMAIL PROTECTED] wrote: > Can anyone elaborate on how 'os.tmpfile()' works? I was thinking it would > create some sort of temporary file I could quickly add text too and then when > I was finished would automatically get rid of it. Here's my questions: ... > Can you actually 'write' t

Re: os.tmpfile() -> permission denied (Win XP)

2007-02-10 Thread John Machin
On Feb 11, 4:33 pm, "John Machin" <[EMAIL PROTECTED]> wrote: > On Feb 11, 4:15 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > > > En Sun, 11 Feb 2007 01:57:52 -0300, John Machin <[EMAIL PROTECTED]> > > escribió: > > > > | >>> os.tmpfile() > > > Traceback (most recent call last): > > > File

Re: os.tmpfile() -> permission denied (Win XP)

2007-02-10 Thread John Machin
On Feb 11, 4:15 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Sun, 11 Feb 2007 01:57:52 -0300, John Machin <[EMAIL PROTECTED]> > escribió: > > > | >>> os.tmpfile() > > Traceback (most recent call last): > > File "", line 1, in > > OSError: [Errno 13] Permission denied > > > 1. Before I

Re: os.tmpfile() -> permission denied (Win XP)

2007-02-10 Thread Gabriel Genellina
En Sun, 11 Feb 2007 01:57:52 -0300, John Machin <[EMAIL PROTECTED]> escribió: > | >>> os.tmpfile() > Traceback (most recent call last): > File "", line 1, in > OSError: [Errno 13] Permission denied > > 1. Before I start checking what permissions who has to do what to > which, what directory i