implementing ui in python code