First app, thanks people

J

Jan Danielsson

Hello all,

I have written my first Python application (apart from small test
programs). It's a (distibuted) white board application. I'm going to
assume that there already are a thousand of them, written in Python, but
just in case someone would find it useful:

http://user.it.uu.se/~jada3673/applications.php
Direct link: http://user.it.uu.se/~jada3673/apps/whiteboard.py

Since I'm a Python beginner, the code is very suboptimal. Anyway, I
believe it may be good reference code for beginners.

Oh, I do have one more question though. I'm using wxPython, and when
I check for keys I use the evt.GetKeyCode() call, and compare it with
integers which I have found by printing what event.GetKeyCode() returns.
I would prefer a more portable way, since I assume that F1 doesn't have
the same code on a Sparc Ultra10. (?) Is there a way to get "key codes"
in wxPython in a portable manner?


I'd also like to thank all of those who have helped me in this group,
and thank everyone else for the interresting discussions.

As for license: Do whatever you want with it, but don't blame me if
it breaks anything or causes spontaneous pain, death or pregnancies.
 
D

Dark Cowherd

Hmm,

I was looking at the code as I am also learning Python.

In case you are interested in bug report.

class LineTool
method OnLeftUp
needs
self.done = True

or else if you are in Line mode and you just click with out moving the
mouse you get an error.


DarkCowherd
 
J

Jan Danielsson

Dark Cowherd wrote:
[---]
In case you are interested in bug report.
Always!

class LineTool
method OnLeftUp
needs
self.done = True

or else if you are in Line mode and you just click with out moving the
mouse you get an error.

Many thanks; I can't believe I hadn't stumbled across that bug myself
while testing it.

Though you are free to do whatever you want with the code, I wouldn't
mind seeing any improvements made to it by others, so that I myself may
learn from it.
 
W

Will McGugan

Jan Danielsson wrote:
..
Oh, I do have one more question though. I'm using wxPython, and when
I check for keys I use the evt.GetKeyCode() call, and compare it with
integers which I have found by printing what event.GetKeyCode() returns.
I would prefer a more portable way, since I assume that F1 doesn't have
the same code on a Sparc Ultra10. (?) Is there a way to get "key codes"
in wxPython in a portable manner?

Hi,

You should use the keycode constants.

http://www.wxwidgets.org/manuals/2.6.1/wx_keycodes.html#keycodes


Will
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top