useful python code