Sorry guys, how do you print a message dialog box if a file doesn't exists in python? I am currently using a program to do segmentation of video file and assembling it the files that I need and excluding those I don't. I have completed the tasks but if I randomly type a file that doesn't exists, it will print an error but what I want is a message Dialog box to appear, is there any way to do this?
you need to put the ode that opens the file in try-except braces.
Then open a wxMessagebox inside the catch(exeption) brace. Its been along time i worked with wx but the style and logic is the same on GUI's.
Let's not forget that WxPython is just the wrapper for WxWindows which is written in C++.
The wrapper seems to ignore the C++ error handling. It could have been done, but wasn't.
I don't think there is any GUI toolkit that is written in pure Python, bummer.
On the other hand Python is very good glue language for other languages. It's easy to make wrappers.