[Tutor] Testing for gui

John Fouhy john at fouhy.net
Wed Nov 9 01:45:07 CET 2005


From: Ken Stevens [mailto:kens7601 at gmail.com]
> Yes. Under Linux no x-server running? I guess it really wouldn't be
> applicable under a windows enviroment, although I would like my code
> to be transportable. Just under a MS windows enviroment it would
> always be a "gui" environment.

What happens if you try to create a GUI and X is not running? Maybe
you could just try to create a Tkinter.Tk() --- if it throws a python
exception (probably TclError), you could just catch that.

--
John.


More information about the Tutor mailing list