Updating example python gui code with more functionality