[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] pygame+threading+windows



Hello,

thank you James and Brian for your comments. This discussion is very
instructive for me. I am not sure if we are getting off-topic, but as
long as no one complaines...

As I said before:
> > 
> > I would like to be able to use all these objects in Python's interactive
> > mode, since I don't want to make a GUI for every little thing I would
> > like to try out.
> > 

Let's extend the example: The camera is recording pictures of a movable
stage. The stage will also be controlled by python. I was thinking of an
interactive python session (e.g. IDLE) like this:


>>>myCamWindow.start()  #now the cam window pops up and displays images

>>>stage.moveTo((100, 100))  #the cam window is still displaying,
because it is a thread, on the same time the stage (controlled by the
main-thread) moves to (100, 100)

>>>point = myCamWindow.getClickedPoint #program excecution will stop
here, until the user clicks on some point in the cam window

>>>stage.moveTo(point) #the stage moves to the point the user clicked on


So, I would like to use GUI-Elements (like the cam window) and the
python interactive mode (like IDLE) *at the same time*. Maybe this is a
bad idea...? The reason for this is, that this is a scientific project.
I don't want to write a GUI-Element for *everything*, because this is
time-expensive. But I *need* *some* GUI-elements (for example the cam
window).

What would your solution be? Write a "real" program, with no possibility
to use python interactively? Doing something completely different?

Thank you for your comments

Lars