ArunRocks

Representing Anti-Monotonistic Tendencies
  • rss
  • Home
  • A little intro to Thrissur
  • Archives
    • Search
  • Resumé
  • About Me
    • Comment policy

Making Python Scripts Show Windows-friendly Errors/Stacktrace

Arun bhai | Wed, Jun 20, 2007

Most of us love to distribute our python programs to others once you have finished coding a neat little script. For Windows users we package it using Py2exe or cx_freeze. However, many of the end-users will not be happy with a black command window popping up, say, when an error is thrown.

Of course the alternative is to write a full blown GUI application using WXPython or PyFLTK. Even the latter, though quite lightweight, adds several megabytes to the distribution, when all you need is a simple message-box indicating an error or showing some informational text. Clearly, its an overkill for your throwaway python scripts.

This is the kind of problem I typically face and I have found a good solution. The answer is ctypes library which comes as a part of the standard distribution from Python 2.5 onwards. It simply calls the messagebox function from user32.dll (which is always present in a windows installation). With the main problem solved, what remained was to obtain the error text and stack trace.

Let’s see how the code looks like:

EDIT: This is how it looks like in PyMail, one of my scripts-that-grew-into-an-app ;)

Screenshot of a Python Stacktrace in a Messagebox

Bookmark this to del.icio.us | Digg | Furl | Netscape | Google Bookmarks | Technorati | reddit |

Comments
No Comments »
Categories
General, Python, Technical, py2exe
Comments rss Comments rss
Trackback Trackback

Yet Another Year To Rock Away*

Arun bhai | Wed, Jun 13, 2007

This year’s birthday was yet again celebrated in the best place I could possibly think to celebrate - Mangalore. Once again they have written a truly wonderful writeup about me. Check it out…

Arun Ravindran

Hmmm..so, the dude in the pic is celebrating his birthday.does he need a formal introduction from us or what??!!! If ever there was one guy about whom it was hard to find a description in just one word, then it is Arun Ravindran.call him a gadget freak, regular blogger, an ardent music lover, photographer, pencil drawing enthusiast, flash programmer..and he will answer to all of your calls!! Because, he is no ordinary person, for him being extraordinary is just another day!!

He was one of the active participants in this year’s Ittesbin Skit from ES. Didn’t get to see him onstage? That’s because he was busy back stage giving voice. And don’t think that his voice talent was limited to just one character; more than one role in the ES skit was backed up by his voice!!

Don’t just think that he is good at the extracurricular stuff; he is one of the back bones of his project team. He had joined Infosys in May 2004 as an A.CON in ES (EAI). After working for the UBS and BP at onsite, he came to GAPEAIR2 project and to Mangalore.

He is one witty person who always likes to see the smile on other people’s face. He is also an avid reader and he constantly updates his blog. Maybe because he is also interested in drawing, all his “sweets at my deskFCFS” mails are associated with maps showing the easiest route to his cubicle!!!

Word has leaked out to the smilES team that he has to keep at least two parties in the food court (excluding all the other parties outside) so as to make all his friends happy, such is his popularity in this Minfy!!

Lets all wish this talented dude a very happy birthday!!

Check out these snaps too

Running for cover Cake at Home

Of course you can enjoy them directly at Flickr

* - The title is inspired from the expansion of Infy rock group - YANTRA which stands for the awesome expansion “Yet another night to rock away”.

Bookmark this to del.icio.us | Digg | Furl | Netscape | Google Bookmarks | Technorati | reddit |

Comments
3 Comments »
Categories
General
Comments rss Comments rss
Trackback Trackback

Your Email:

Categories

  • emacs
  • General
  • greasemonkey
  • indie
  • launchy
  • Pocketmod
  • productivity
  • py2exe
  • Reviews
    • Books
    • Movies
  • Short Stories
  • Technical
    • Gaming
      • Unni
    • Python
    • WordPress

Recent Posts

  • Ledger’s Joker Chills, Thrills and Entralls
  • Reading Hindu Online Made Better with Greasemonkey
  • Better Fonts Tip: Biggest Improvement in Ubuntu Appearance
  • Best Dialogs of Salim Kumar
  • Learning Pylons Through Tutorials

Recent Comments

  • Arun bhai on Best Dialogs of Salim Kumar
  • Thomas on Best Dialogs of Salim Kumar
  • Nidhish on Best Dialogs of Salim Kumar
  • abhilash on Learning Pylons Through Tutorials
  • Bookmarks about Ubuntu on Better Fonts Tip: Biggest Improvement in Ubuntu Appearance

Meta

  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org

Bookmarks

del.icio.us/arun_ravindran I am arun_ravindran on del.icio.us
add arun_ravindran to your network Add me to your network
rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox