damacy wrote: > hello, everyone. > > i am trying to write a program which executes SQL commands stored in > .sql files. > > i wrote a function called psql() whose contents look like the > following. > > ... > os.popen(command) > file = os.popen(command, 'w') > file.write(password) > file.close() > ... > > where command looks like > psql -h [host] -d [dbname] -U [username] -W -f "[filename]" > > this works well.
But is a very strange way to access a RDBMS from Python code. Are you aware of the existence of db modules ? > can anyone help me? http://www.python.org/dev/peps/pep-0249/ http://initd.org/projects/psycopg1 -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in '[EMAIL PROTECTED]'.split('@')])" -- http://mail.python.org/mailman/listinfo/python-list