"print" strange with Sybase module

Carsten Gaebler cg at schlund.de
Thu Jan 25 07:04:10 EST 2001


Hi there!

The following simple program (sqltest.py) returns about 20 lines of
Sybase output when run as "./sqltest.py". But if I say

./sqltest.py | tee /tmp/test.txt

there is no output and test.txt is empty. What's going wrong? It's
Sybase module 0.10 with Python 2.0.

#!/usr/bin/python
import Sybase

query = "select * from shorttable"

syb_db = Sybase.connect('server', 'username', 'passwd')
syb_db.execute('use mydb')

rows = syb_db.execute(query)[0]
for row in rows: print row

syb_db.close()


Regards
Carsten.



More information about the Python-list mailing list