Python Insert Variable Into String Javascript Substring Replace