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)."

I didn't notice this limitation when reading the doc, thanks to point
me to it.

So for the future newbie that look something like this, here is my
final code:

fd, filename = tempfile.mkstemp(suffix='.sql')
f = os.fdopen(fd, 'wb')
try:
    f.write(txt.encode('cp1252'))
    f.close()
    p = Popen([SQL_PLUS, '-s', dsn,
        '@', SQL_PLUS_SCRIPT, filename],
        stdout=PIPE, stderr=STDOUT)
    p.wait()
finally:
    os.remove(filename)


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

Reply via email to