How To Manage State In Python