2 Reusable Code Snippet Topics

Remove Filter
Member Avatar for
Member Avatar for Momerath

Quite commonly I see people using one of the Parse routines then catching the exception thrown if the parse fails. This is, in general, a bad practice as throwing an exception is slower than using the corresponding TryParse method. This short snippet shows the routines that I used to measure …

Member Avatar for Mickey_1
0
557
Member Avatar for Gribouillis

This snippet defines a function [icode]exc_browse()[/icode] which displays the current python exception in the web browser. This can be useful to non web programmers who want a nicely displayed exception traceback (web frameworks usually include this feature). The idea of this function is to store the html code generated by …

0
244

The End.