Python Function Modify Input Html