Add sleep in python code