You seem to be implying that you'd maintain two versions of your application -- one which runs via Tk, and one which is a console app. This is a lot of extra work. Also, consider that X is running may not be the only appropriate time to use Tk -- Windows, for example, can run Tk apps without an X server available.
There are two problems here -- detecting whether to use a GUI, and creating an application that is dual-mode.
Well, for one thing this won't run under Windows in any case. So that's not a problem. Said this, if you read
432975 more carefully you'll notice that I wrote
"[...] in that case I would put most of the non-UI code into a module and call it from the respective '.X' and '.cmd' versions.", which is fundamentally what you suggest yourself.
Taking into account both this circumstance and the fact that after all it will be a relatively simple application, it most certainly won't be "a lot of extra work".
The only problem here is detecting X and running a GUI version if it is available or a CLI version otherwise, which doesn't seem to be a choice everybody agrees on, but that's another matter...
In any case thank you for the feedback!