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.Tempor
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.Tempor
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
--
http://mail.python.org/mailman/listinfo/python-list
[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
>
if this is the most efficient way to do this or
not but
thought at least it'd be a good way to learn something new in Python. I was
assuming tmpfile() would automatically create some sort of temporary file that
would automatically delete itself when the code was finished.
--
> Try thi
[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'
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 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:
1. Does it actually create a file somewhere? If so
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ó:
>
> > > | &g
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 "", l
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 wh
Hi,
Here's what's happening:
Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
| >>> import os
| >>> os.tmpfile()
Tracebac
". I would like to switch to os.tmpfile() which is supposed
> to be safer, but I do not know how to get the path information from
> the file object returned by tmpfile(). any clues?
You can't. The file opened doesn't have a name
tmpfile(...)
tmpfile() -> file obj
Chris Lambacher wrote:
> You should be able to find exactly what you need in the tempfile module.
> http://docs.python.org/lib/module-tempfile.html
thanks! tempfile.NamedTemporaryFile() is exaclty what I have been
looking
for. Using python for such a long time now, and still there are unknown
goo
Harold Fellermann wrote:
> Maric Michaud wrote:
>
>>Le Jeudi 08 Juin 2006 15:30, Harold Fellermann a écrit :
>>
>>>to os.tmpfile() which is supposed to be safer, but I do not know how to
>>>get
>>>the path information from the file object returned by t
You should be able to find exactly what you need in the tempfile module.
http://docs.python.org/lib/module-tempfile.html
os.tmpfile() is no good whether you want the filename or not since on Windows
it is likely to break if you are not a privileged user. Its a windows
problem, not an actual bug
ss.PIPE, stdout=file(tmp,"w")
> )
> stdout,stderr = gnuplot.communicate("""
> set terminal tkcanvas interact
> set output "%s"
> """ % tmp + commands)
assuming tmp is a os.tmpfile and y
Maric Michaud wrote:
> Le Jeudi 08 Juin 2006 15:30, Harold Fellermann a écrit :
> > to os.tmpfile() which is supposed to be safer, but I do not know how to
> > get
> > the path information from the file object returned by tmpfile(). any
> > clues?
> There is no path
Le Jeudi 08 Juin 2006 15:30, Harold Fellermann a écrit :
> to os.tmpfile() which is supposed to be safer, but I do not know how to
> get
> the path information from the file object returned by tmpfile(). any
> clues?
There is no path for tmpfile, once it's closed, the file an
Hi,
I need to create a temporary file and I need to retrieve the path of
that file.
os.tmpnam() would do the job quite well if it wasn't for the
RuntimeWarning
"tmpnam is a potential security risk to your program". I would like to
switch
to os.tmpfile() which is supposed to be safe
21 matches
Mail list logo