Question about StringIO

Diez B. Roggisch deets at nospam.web.de
Mon Oct 10 18:35:14 EDT 2005


> Thanks, Steve and Diez, for the replies. I didn't think it was
> possible, but it was worth asking :-)
> 
> I will try to explain my experience with popen() briefly.
> 
> I have some sql scripts to create tables, indexes, procedures, etc. At
> present there are about 50 scripts, but this number will grow. I have
> been running them manually so far. Now I want to automate the process.
> 
> I am supporting PostgreSQL and MS SQL Server, and the syntax is
> slightly different in some cases. Rather than maintain two sets of
> scripts, I prefix some lines with -pg- or -ms- to indicate the
> platform, and then use Python to parse the scripts and generate a
> correct output for each platform, passing it to 'psql' and 'osql'
> respectively, using popen().

Why don't youn use te python DB-Api instead?


Regards,

Diez



More information about the Python-list mailing list