code revised for finding absolute path
Gainchart python version