Is there a GUI for informing a user of missing dependencies?

J

Jason

I'm writing a small GUI (Python 2.5/6) using wxPython and pySerial.
Since these are both 3rd party modules, if a user doesn't have them
installed and tries to run the GUI from a file browser, the app will
fail silently. I'm hoping to avoid that.

Sure, I'll have a readme file, but I was wondering if there is an even
more direct way. I was going to roll my own (eg. very simple Tkinter
fallback error dialog if wxPython import fails, wxPython error dialog
if anything else is missing); but I was wondering if such a system
already exists out there.

— Jason
 
D

Dave Angel

Jason said:
I'm writing a small GUI (Python 2.5/6) using wxPython and pySerial.
Since these are both 3rd party modules, if a user doesn't have them
installed and tries to run the GUI from a file browser, the app will
fail silently. I'm hoping to avoid that.

Sure, I'll have a readme file, but I was wondering if there is an even
more direct way. I was going to roll my own (eg. very simple Tkinter
fallback error dialog if wxPython import fails, wxPython error dialog
if anything else is missing); but I was wondering if such a system
already exists out there.

— Jason
One approach is something like:

import subprocess

errorstring = "echo XXX error occurred in my code. type 'exit' to close
this shell window "
parms = ["cmd.exe", "/k"]
parms.append( errorstring )
subprocess.call(parms)

Any message can be built as long as it fits on one "line". And if more
is needed, a batch file can be run instead of just "echo" at the
beginning of the errorstring.

The user gets a command shell that he can then use to investigate
various things, such as environment variables. And the shell goes away
when he types the command "exit". The python program doesn't terminate
till the user does so.

This is Windows specific, so certainly your Tkinter approach is more
general. On the other hand, the user might have a subset of the standard
Python installed, and Tkinter might have been deleted from his system.

If it has to work on older Python versions, you might go with
os.system() or other similar things.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top