generate python file for gui