Python code operates in new directory