minimize python interpreter runs on startup.

also, improve error checking a bit.