opkg update
opkg install python-psycopg
nano postgre.py
# -*- coding: utf-8 -*-
import psycopg
    conn = psycopg.connect("dbname='mypgdatabase' user='postgres' host='' password='password'")
    print "I am unable to connect to the database"
cur = conn.cursor()
cur.execute("select username,password from login")
rows = cur.fetchall()
print "\nShow me the databases:\n"
for row in rows:
    print "   ", row[0], "   ", row[1]
chmod 755 postgre.py


Comments powered by CComment