Block Styler can generate code in all the usual supported languages, including Python. The “Generate Code” function in Block Styler has a menu for choosing the output language. It’s completely independent from the language setting for recording journals.
I don’t know whether tkinter works or not. But, even if it does, it will be difficult to create a UI that looks and behaves like the rest of NX. Simple stuff might work OK, but implementing graphical selection of NX objects (for example) is going to be a major pain.