add pwr.py, change to sqlite3, runable