If it won't be simple, it simply won't be. [Hire me, source code] by Miki Tebeka, CEO, 353Solutions

Wednesday, May 24, 2006

wxPython calculator in 50 lines of code



11 comments:

Anonymous said...

I'm usually a lurker but, with this wxPython calculator I had to change line 55:

label = evt.GetEventObject().GetTitle()

to:

label = evt.GetEventObject().GetLabel()

before it would work.

Nice blog. Good luck with it.

Best wishes

Ivan

Miki Tebeka said...

Hello Ivan,

Thanks for being 1'st commenter of my blog :)

evt.GetEventObject().GetTitle() works for me on wxPython 2.6.3.2.

Maybe I should add version information in my posts...

Miki

Anonymous said...

I seem to be using wxPython 2.6.3.3 (going by python-wxgtk2.6/CHANGES.txt) on Debian (so that's wx-2.6-gtk2-unicode). I haven't tested it on Windows yet (I'll get round to that sooner or later).

I came across your blog as I was looking for samples of wxPython code. I'm doing a comparison of wxPython vs Tkinter+PMW.

I like the SWIG-aspect of wxPython, although I've yet to experiment with SWIG.

Best

Ivan

Anonymous said...

Sorry that's 2.6.3.2. 2.6.3.3 isn't out yet. Ivan

Anonymous said...

Just tested the code on Windows (2K): it works fine with GetTitle() or GetLabel()!

Ivan

Anonymous said...

Cool code! I'd like to borrow it for teaching purposes.

Miki Tebeka said...

Hello Rune,

As long as you mention my name somewhere you can borrow as much as you like :)

Have fun,
Miki

Anonymous said...

That's a deal! Thanks. Name and URL.

Miki Tebeka said...

Changed the code to use GetLabel, will make it more generic.

Thanks,
Miki

Unknown said...

can i borrow the code? (dont worry ill give you full credit)

where buy cialis said...

This blog is very interesting and has a lot of feature articles.
Accept my greetings

Blog Archive