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
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
[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
>
> 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
[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
Try this:
>>> import os
>>> c = os.tmpfile()
>>> c.write('dude')
>>> c.seek(0)
>>> c.read()
'dude'
--
http://mail.python.org/mailman/listinfo/python-list
[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
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
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
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
10 matches
Mail list logo