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



12 comments:

Ivan 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 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

Ivan 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

Ivan said...

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

Ivan said...

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

Ivan

Rune said...

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

Miki said...

Hello Rune,

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

Have fun,
Miki

Rune said...

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

Miki said...

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

Thanks,
Miki

Anonymous said...

Validation of be in force Our Risqu‚ Prices at www.Pharmashack.com, The Unrivalled [b][url=http://www.pharmashack.com]Online Chemist's snitch on [/url][/b] To [url=http://www.pharmashack.com]Buy Viagra[/url] Online ! You Can also Espy Choice Deals When You [url=http://www.pharmashack.com/en/item/cialis.html]Buy Cialis[/url] and When You You [url=http://www.pharmashack.com/en/item/levitra.html]Buy Levitra[/url] Online. We Also Would measure a Mammoth Generic [url=http://www.pharmashack.com/en/item/phentermine.html]Phentermine[/url] In prop up of Your Eats ! We Vend Pre-eminence epithet [url=http://www.pharmashack.com/en/item/viagra.html]Viagra[/url] and Also [url=http://www.pharmashack.com/en/item/generic_viagra.html]Generic Viagra[/url] !

sam 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