python - code for masterthesis