Differences between revisions 2 and 3
Revision 2 as of 2004-04-04 17:48:35
Size: 273
Editor: ipd50a4151
Comment:
Revision 3 as of 2004-04-28 08:51:23
Size: 688
Editor: c66-235-5-228
Comment:
Deletions are marked like this. Additions are marked like this.
Line 5: Line 5:




You can always redirect where the errors go with the sys module.
sys.stderr = StringIO.StringIO() will redirect error messages to a string in your program that no one will ever see.

A better option is a log file, then they can see the errors if the want to but don't have to
sys.stderr = open("logfile.txt","w")

if you want to redirect print statements as well, point sys.stdout to some other file

A GTK application I made has unimported errors. I used the option 'windows', but the console window gets opened when getting an error. And maybe a tip, when closing the program it should be optional whether or not it warns for errors.

Mark Baas <m.baas _at_ zarb.org>

You can always redirect where the errors go with the sys module. sys.stderr = StringIO.StringIO() will redirect error messages to a string in your program that no one will ever see.

A better option is a log file, then they can see the errors if the want to but don't have to sys.stderr = open("logfile.txt","w")

if you want to redirect print statements as well, point sys.stdout to some other file

GuiApps (last edited 2015-04-29 09:11:14 by JimmyRetzlaff)