adding a code which works with show() in python and timer