[BUG #7781] adapt runnable python scripts to be valid 2.6.x, 2.7.x and 3.x python code