use openshift env to determine python version and some improvement.

use openshift env to determine python version. 
execfile() has been removed from python3 use exec instead for both py2 and py3. 
env APPDIR not exist, use OPENSHIFT_REPO_DIR instead.

> some change just follow from flask-example