Function to create python test file