Merge code into one file

Asked by Megaqwerty

I was wondering if once I've finished writing all of the callbacks, if it is possible to merge them back into the main file; so I only have to deal with one .py file?
If so, how?


Question information

English Edit question
Gladex Edit question
No assignee Edit question
Solved by:
Christopher Pax
Last query:
Last reply:
Revision history for this message
Best Christopher Pax (paxmanchris) said :

sorry for taking so long to respond to your question. I have been away from my email for the past day.

I programed it to be separated because if the main py file ever had to be rewritten you can do it with out touching the callbacks file.

I would recommend to keep them separated.

but, you can do the fallowing to do what u want to do:
note: this was using python on a minimal style

1) look for the line in the main py (in my case file that would look like this if the glade file was

import example_callbacks as callbacks

2) replace with this:
import example as callbacks

3) now copy all the callbacks function into the main py file ( and place at the bottom (including the init function).

this should work. if you have trouble doing this let me know and i will email the solution.

Revision history for this message
Megaqwerty (matthewb) said :

Thanks, it works now. However, in addition to changing "import example_callbacks as callbacks", I also had to delete/comment out:

Thanks again.

Revision history for this message
Megaqwerty (matthewb) said :

Thanks Christopher Pax, that solved my question.