Re: how to pipe to variable of a "here document"

2006-04-09 Thread Burton Samograd
[EMAIL PROTECTED] writes:

> I need to execute sql command using a "here document" like in unix.
> 
> os.popen("osql", "w").write("""\
> select * from table
> go
> """)
> 
> how can i pipe these result of the select into a variable?

popen doesn't work that way.  you can only open them read or write.
you'll have to create a couple of pipes (one for reading, one for
writing), do a fork, execve, etc with the posix api.  at least that's
how one does it in C...i'm a bit new to python so there might be
better ways.

-- 
burton samograd kruhft .at. gmail
kruhft.blogspot.com www.myspace.com/kruhft  metashell.blogspot.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: how to pipe to variable of a "here document"

2006-04-10 Thread Lawrence D'Oliveiro
In article <[EMAIL PROTECTED]>,
 Dennis Lee Bieber <[EMAIL PROTECTED]> wrote:

>Question: Is there a DB-API module that can directly connect to the
>database server?

There certainly is for MySQL, which is what I mostly use.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: how to pipe to variable of a "here document"

2006-04-10 Thread gry
http://www.python.org/doc/topics/database/

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