move python code to file