Please, I Have A Question before I get started

S

Skipper

Hi All,

I am going to try and learn Python because I want to write at least
one program to help my disabled son with communitation.

I am not asking for anyone to do this for me I simply want to know if
I can do what I need to do with Python ....

Basically the program will blank the screen and call up (for example)
6 pictures. A flashing border with travel from picture to picture.
When the computer senses a mouse click it will clear the screen and
present a second set of choices ... one level deeper than the first
.... based on the chosen picture.

So again ... "menu pictures" of food, drink, tv are highlited for 5
seconds each. the chooser sends an input (mouse click for eample)
while the tv is highlited. The screen clears and another picture menu
appears ... this one a deeper level of the chose TV - maybe it is
pictures of a cartoon and a ball ... a ball is chosen ... the screeen
clears and menu choices of a baseball, basketball or football
appear... my son chooses the baseball ... he has now worked through
three menu levels to let us know what he would like to watch on TV....

Can python do this? I realize I am responsible for the menu sets,
pictures .... attaching sounds etc ....

TIA

Mike
 
S

Steven D'Aprano

Hi All,

I am going to try and learn Python because I want to write at least
one program to help my disabled son with communitation.

I am not asking for anyone to do this for me I simply want to know if
I can do what I need to do with Python ....
[snip]

Can python do this? I realize I am responsible for the menu sets,
pictures .... attaching sounds etc ....

There is no reason why Python can't do this.

If you are new to programming, I suggest you have a look at Pythoncard.
Unfortunately, most of the Graphical User Interface libraries for Python
have a fairly steep learning curve, and in general building GUIs can be
tedious and difficult, regardless of language. Pythoncard is an attempt to
simplify the whole process and make simple things simple.

http://pythoncard.sourceforge.net/
 
Y

Yu-Xi Lim

Skipper said:
Hi All,

I am going to try and learn Python because I want to write at least
one program to help my disabled son with communitation.
snip

Can python do this? I realize I am responsible for the menu sets,
pictures .... attaching sounds etc ....

An interesting project.

As Steven mentioned, the GUI toolkits for python (and several other
major programming languages such as Java and C) are challenging. I
recommend you start with something that is already GUI-oriented that
would eliminate a lot of the difficulty of display images, detecting
mouse clicks, etc.

The first thing that comes to mind would be Powerpoint with some short
custom Visual Basic code. Another very easy alternative may be HTML with
some basic Javascript. It won't take 10 lines of code if you make some
compromises on the presentation but you can't include sound. More
complex would be stuff like Flash. All would probably take you less time
to learn than Python and a GUI toolkit.
 
A

Alex Martelli

Steven D'Aprano said:
There is no reason why Python can't do this.

If you are new to programming, I suggest you have a look at Pythoncard.

For the original poster's purposes, I was thinking as PyGame (and PyUI
on top of it) as perhaps more suitable. But, sure, it won't be a
cakewalk, for somebody without any programming experience, with either
toolkit set (Pythoncard+wxPython, or PyUI+PyGame).


Alex
 
S

Steven D'Aprano

For the original poster's purposes, I was thinking as PyGame (and PyUI
on top of it) as perhaps more suitable. But, sure, it won't be a
cakewalk, for somebody without any programming experience, with either
toolkit set (Pythoncard+wxPython, or PyUI+PyGame).


Where did we go wrong? This sort of project would have been literally a 30
minute job with Apple's now defunct Hypercard program, and 20 of those
minutes would be looking for suitable images to use.

It's half a decade into the 21st century. Why aren't there modern,
advanced GUI development systems that have as simple a front end as
technology that existed in 1988?
 
S

Steven D'Aprano


What does this have to do with anything I wrote? I didn't ask for a silver
bullet that will solve any programming problem imaginable. I didn't even
ask for a general procedure or methodology that will make programming
projects either to manage.

I'm not stupid -- I understand that there is no magic bullet that will
solve every problem. As programming tools and methodologies get better at
handling hard problems, we look at even harder problems. That's not what
I'm talking about.

But in 1988 the technology existed to create simple GUI applications with
virtually no programming needed. (Yes, they were simple. Simple is not
necessarily a bad thing.) Today, it seems to me that there is no
technology available to allow non-programmers to create simple GUI
applications: the state of technology, which has made progress in so many
ways, has actually gone backwards in this regard.
 
S

Steven D'Aprano

The first thing that comes to mind would be Powerpoint with some short
custom Visual Basic code.

That's good thinking.

If you don't have Microsoft Office, OpenOffice will do the same thing, and
unlike Office, it is free.

The presentation package in OpenOffice, Impress, allows you to build
clickable objects that jump to another slide without writing code. Also,
OpenOffice will allow you to export your presentation to a Flash animation.

http://www.openoffice.org/
 
R

Ravi Teja

Sigh. I could not have imagined that a link without an offending word
could be taken as an insult. Perhaps the lack on accompanying text
contributed? Anyway, it just was not my day (and not just you).

To me, that article makes many points. I was thinking in terms of
technology stagnation and particularly, essential complexity that the
author stresses. That things don't keep getting much better after a
point.

I do not think that technology has gone backwards. Hyper card
alternatives still exist.
http://www.metacard.com/
They just aren't as popular anymore or obvious choices. Back then,
there weren't that many alternatives. I could either program a GUI in C
or to use Hypercard. The difference was stark, the choices were obvious
and the market was focussed.
 
D

Diez B. Roggisch

Skipper said:
Hi All,

I am going to try and learn Python because I want to write at least
one program to help my disabled son with communitation.

I am not asking for anyone to do this for me I simply want to know if
I can do what I need to do with Python ....

Basically the program will blank the screen and call up (for example)
6 pictures. A flashing border with travel from picture to picture.
When the computer senses a mouse click it will clear the screen and
present a second set of choices ... one level deeper than the first
... based on the chosen picture.

Are you aware of this:

http://pythonology.org/success&story=natsworld

Maybe it offers what you need - and certainly it shows that these kind of
things can be done using pygame.

Diez
 
S

Skipper

Thank you all so much for your input. The feedback was perfect. I
did not realizethis may be difficult under any circumstances.

I am very familiar with PowerPoint and will try the open office
thing...

I can not believe that there isn't a GUI programing tool that will
allow me to build GUI apps - just like I use Dreamweaver to build a
web page ... a WYSIWYG builder that does a few simplet things and
calls other programs ...

Oh well .... no silver bullet!

Thanks again
Mike







Hi All,

I am going to try and learn Python because I want to write at least
one program to help my disabled son with communitation.

I am not asking for anyone to do this for me I simply want to know if
I can do what I need to do with Python ....
[snip]

Can python do this? I realize I am responsible for the menu sets,
pictures .... attaching sounds etc ....

There is no reason why Python can't do this.

If you are new to programming, I suggest you have a look at Pythoncard.
Unfortunately, most of the Graphical User Interface libraries for Python
have a fairly steep learning curve, and in general building GUIs can be
tedious and difficult, regardless of language. Pythoncard is an attempt to
simplify the whole process and make simple things simple.

http://pythoncard.sourceforge.net/
 
S

Sybren Stuvel

Skipper enlightened us with:
I can not believe that there isn't a GUI programing tool that will
allow me to build GUI apps

There are plenty of them.
just like I use Dreamweaver to build a web page

Which produces horrible HTML.

Sybren
 
S

Scott David Daniels

Skipper said:
... I am not asking for anyone to do this for me I simply want to
know if I can do what I need to do with Python ....
Can python do this? I realize I am responsible for the menu sets,
pictures .... attaching sounds etc ....

As you have been told by many other respondents above, the task is
not as simple as it seems it should be. If you decide to go ahead
and attempt it in Python (after you have learned some easier stuff),
you will definitely get lots of assistance here. You just need to
decide which mountains you want to climb, and which ones you pass up.

--Scott David Daniels
(e-mail address removed)
 
J

JW

Skipper said:
I can not believe that there isn't a GUI programing tool that will
allow me to build GUI apps - just like I use Dreamweaver to build a
web page ... a WYSIWYG builder that does a few simplet things and
calls other programs ...

Oh well .... no silver bullet!

If you are interested in programming, the best way is to find a
motivating goal to learn. It sounds like you have a very motivating
goal. However, it will probably take quite a long time for you to get
to a point where you can make a useful tool for your son. While your
problem description is straightforward, the implementation is not.

One route you might consider is contacting your local engineering
college for help. My alumnus recently solicited funds for a "Life
Interaction Device" for Abigail, a 6 year old girl with Cerebral Palsy:

http://www.ee.utulsa.edu/Abigail/index.html

It sounds as if Abagail's needs are far greater than your son's, but
your project would make an interesting design project for CS students
at an undergraduate level.
 
P

paron

Since you are comfortable with HTML, you could use the browser as your
GUI, and use a lightweight python server like Karrigell (or CherryPy,
or Turbogears) to serve the pages. A little javascript to move the
highlighting around, and . . .

Well, frankly, it's still harder than it ought to be. (I agree with
Steven, it sure seems like it has been long enough.) It's not totally
dreadful, though, and it is free.

Ron
 
P

paron

Well, there's OpenLaszlo, which handles the sounds/animation for
http:www.pandora.com, I understand. It may be overkill for a desktop
app, but it's free. It was originally written in Python, I think, but
it uses ECMAScript for scripting.

It's free, and reportedly handles sounds and animations, and isn't too
hard to program.

Ron
 
T

Terry Hancock

Basically the program will blank the screen and call up
(for example) 6 pictures. A flashing border with travel
from picture to picture. When the computer senses a mouse
click it will clear the screen and present a second set of
choices ... one level deeper than the first ... based on
the chosen picture.

So the key difference from, say, a web page in a browser,
is that you want the choice to be determined by timing,
not by where the mouse is pointed?

This is actually quite non-standard, so there won't be
a lot of support for it in GUI-building tools.

However, it is the sort of thing that a game toolkit is
well-organized for. IMHO, PyGame is probably very close
to the fastest way to achieve this. But you will have
to learn how to create a data model for your menus,
etc.

The main module can be dead simple, though. You just
need to paste in a little PyGame boilerplate at the
top (examples are included in the PyGame distribution),
then you'll have a loop that handles displaying a menu,
rotating through the choices, and listening for keyboard
input. Something like this (I'm writing from memory --
you'll have to check the pygame documentation (which is
excellent, BTW) to find details):

import pygame
from pygame.locals import *
pygame.init()

screen = pygame.display.set_mode((800,600))
# There are smarter ways to do this, but for
# a one-off project, just use your known screen size

# HERE YOU NEED TO BUILD YOUR MENU TREE
# I'm assuming a tree structure of some
# kind with some obvious methods attached
# to each node

current_menu = root_menu
while 1:
current_menu.display()
try:
for choice in current_menu.choices:
root_menu.highlight(choice)
t0= pygame.time.get_ticks()
t = t0
while t<t0+5000.0:
t = pygame.time.get_ticks()
pygame.event.pump()
for event in pygame.event.get():
if event.type == KEYDOWN:
if event.key == K_q:
sys.exit(0)
else:
current_menu = choice.act()
raise StopIteration
except StopIteration:
continue


At least I think that's about right. The idea is, you
dispatch all of your actions from the menu objects,
which you display at the top level of the loop. Then,
you loop through the possible choices, and listen for
a key stroke, if there is one, then you dispatch the
appropriate reaction, possibly returning something
other than the current menu (in which case, the
current menu changes).

You can also do this using timer events, but I think
that might confuse you for a project this simple. The
get_ticks approach ought to work.

And of course, you need some way to get out of the
program -- this code listens for the "Q" key to be
pressed to exit the program.

The menu objects must look something like this:

class Menu(object):
def __init__(self, ...):
# stuff defining the look of the menu, what
# the choices are and pictures, etc.

# one of the attrib is a list of callable
# objects representing each action
choices = []
pass

def display(self, ...):
# code to paint the screen with this menu,
# using PyGame code (load images, blit to
# screen, etc)
pass

def highlight(self, choice):
# this code makes the highlight effect for
# a choice
pass

You'll also need a choice object:

class Choice(object):
def __init__(self, parent, target=None, ...):
# parent is the menu this choice is in:
self.parent = parent

# target is the menu this action takes you to
self.target = target

def __call__(self):
# this will take whatever the required action is
# For actions which don't change the menu (maybe
# they play a sound, for example), just return the
# parent, otherwise return the target so we can
# go there:
if not target:
return self.parent
else:
return self.target

This is far from working code, but maybe it'll
give you an idea of how you might approach the problem.

Cheers,
Terry
 
S

Skipper

Well, thank you so much for taking the time to reply. I guess that
about wraps up all my questions.


You fucking putz
 
S

Skipper

Thanks to all (except one - of course) for your replys. I think you
have more than answered my question and I appreciate your time.

I suppose this is going to be more difficult than I imagined... but
working at this is better then watching "Trading Spaces" with my wife
- -heh...

Thanks again

Mike
 

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
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top