history file update python