Laszlo Nagy wrote:
However, it won't work for temporary files. Temporary files are just
file-like objects, and their name is ''. I guess I could open a
temporary file with os.open, and then use os.dup, but that is low level
stuff. Then I have to use os.* methods, and the file
ot;rb")
self.fin.seek(file_object.tell())
...
However, it won't work for temporary files. Temporary files are just
file-like objects, and their name is ''. I guess I could open a
temporary file with os.open, and then use os.dup, but that is low level
stuff. Then I have to use o
aditya shukla wrote:
I am trying to create a temporary file.
import tempfile
temp = tempfile.NamedTemporaryFile(suffix='_suffix',
prefix='prefix_',
dir='/tmp',
aditya shukla wrote:
I am trying to create a temporary file.
import tempfile
temp = tempfile.NamedTemporaryFile(suffix='_suffix',
prefix='prefix_',
dir='/tmp',
I am trying to create a temporary file.
import tempfile
temp = tempfile.NamedTemporaryFile(suffix='_suffix',
prefix='prefix_',
dir='/tmp',
)
try:
print
In message <[EMAIL PROTECTED]>, Sebastian "lunar" Wiesner
wrote:
> Relying on the destructor is *always* a bad idea, you should always
> close files explicitly!
There shouldn't be any problem with files opened read-only.
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] <[EMAIL PROTECTED]>:
> When I create temporary file using the tempfile module, and forkI)
> later on in my program, I always see errors when the program exits. Is
> this because the child process deletes temp file?
> Here's a stripped down version of my sc
Hello pythoners,
When I create temporary file using the tempfile module, and forkI)
later on in my program, I always see errors when the program exits. Is
this because the child process deletes temp file?
Here's a stripped down version of my script that exhibits this
problem:
#!/usr/bin/p
On Oct 31, 2:16 pm, Sion Arrowsmith <[EMAIL PROTECTED]>
wrote:
> " [ ... ] Whether the name can be used to open the file a second time,
> while the named temporary file is still open, varies across platforms
> (it can be so used on Unix; it cannot on Windows NT or later).&qu
looping <[EMAIL PROTECTED]> wrote:
>I want to create a temporary file, read it in an external command and
>finally delete it (in Windows XP).
>
>I try to use tempfile module but it doesn't work, the file couldn't be
>open by my other process (error like: SP2-0310: u
t.encode('cp1252'))
> f.close()
> p = Popen([SQL_PLUS, '-s', dsn,
> '@', SQL_PLUS_SCRIPT, f.name],
> stdout=PIPE, stderr=STDOUT)
> p.wait()
> finally:
> os.remove(filename)
>
> I understand the security issues
n,
'@', SQL_PLUS_SCRIPT, f.name],
stdout=PIPE, stderr=STDOUT)
p.wait()
finally:
os.remove(filename)
I understand the security issues of temporary file (as explained in
Python doc) but maybe standard lib need a NamedTemporaryFile that
could be used by another process.
--
http://mail.python.org/mailman/listinfo/python-list
looping wrote:
> Hi,
>
> I want to create a temporary file, read it in an external command and
> finally delete it (in Windows XP).
>
> I try to use tempfile module but it doesn't work, the file couldn't be
> open by my other process (error like: SP2-0310: unab
Hi,
I want to create a temporary file, read it in an external command and
finally delete it (in Windows XP).
I try to use tempfile module but it doesn't work, the file couldn't be
open by my other process (error like: SP2-0310: unable to open file "c:
\docume~1\looping\locals
Ok, thanks for the advice.
Frank
--
http://mail.python.org/mailman/listinfo/python-list
Frank Millman wrote:
> It is certainly possible to store the entire report in memory, using a
> two-dimensional list (page/line), but if a report runs into hundreds of
> pages, I am concerned at the amount of memory this would require.
> Perhaps I am being old-fashioned - with todays memory of at
Frank Millman wrote:
> > Hi all
> >
> > I need to generate potentially large reports from a database, and I
> > want to offer the option of print preview before actually printing
> > (using wxPython). I figure that the best way to achieve this is to
> > writ
at the best way to achieve this is to
> write the report to a temporary file, or more likely to a temporary
> directory with a separate file for each page. I can use that for
> previewing and for printing, and then delete the file/directory.
>
> There seems to be a few ways to ach
Hi all
I need to generate potentially large reports from a database, and I
want to offer the option of print preview before actually printing
(using wxPython). I figure that the best way to achieve this is to
write the report to a temporary file, or more likely to a temporary
directory with a
19 matches
Mail list logo