470,841 Members | 1,159 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,841 developers. It's quick & easy.

Please, I Have A Question before I get started

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

Mar 13 '06 #1
23 1497
On Mon, 13 Mar 2006 02:19:39 +0000, Skipper wrote:
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/
--
Steven.

Mar 13 '06 #2
Steven D'Aprano <st***@REMOVETHIScyber.com.au> wrote:
...
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.


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
Mar 13 '06 #3
Skipper wrote:
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.
Mar 13 '06 #4
On Sun, 12 Mar 2006 19:43:07 -0800, Alex Martelli wrote:
Steven D'Aprano <st***@REMOVETHIScyber.com.au> wrote:
...
> 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.


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?

--
Steven.

Mar 13 '06 #5
On Sun, 12 Mar 2006 20:19:06 -0800, Ravi Teja wrote:
http://www-inst.eecs.berkeley.edu/~m...verBullet.html


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.
--
Steven.

Mar 13 '06 #7
On Sun, 12 Mar 2006 22:41:14 -0500, Yu-Xi Lim wrote:
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/
--
Steven.

Mar 13 '06 #8
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.

Mar 13 '06 #9
Skipper wrote:
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
Mar 13 '06 #10
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



On Mon, 13 Mar 2006 13:45:05 +1100, Steven D'Aprano
<st***@REMOVETHIScyber.com.au> wrote:
On Mon, 13 Mar 2006 02:19:39 +0000, Skipper wrote:
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/


Mar 13 '06 #11
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
--
The problem with the world is stupidity. Not saying there should be a
capital punishment for stupidity, but why don't we just take the
safety labels off of everything and let the problem solve itself?
Frank Zappa
Mar 13 '06 #12
Skipper wrote:
... 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
sc***********@acm.org
Mar 13 '06 #13
JW
Skipper wrote:
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.

Mar 13 '06 #14
Ravi Teja wrote:
I do not think that technology has gone backwards. Hyper card
alternatives still exist.
http://www.metacard.com/


At $995 per seat it's not likely to be used for a home project.

Kent
Mar 13 '06 #15
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

Mar 13 '06 #16
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

Mar 13 '06 #17
Well, thank you so much for taking the time to reply. I guess that
about wraps up all my questions.
You fucking putz

On Mon, 13 Mar 2006 13:37:36 +0100, Sybren Stuvel
<sy*******@YOURthirdtower.com.imagination> wrote:
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


Mar 14 '06 #18
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

On Mon, 13 Mar 2006 08:53:51 -0800, Scott David Daniels
<sc***********@acm.org> wrote:
Skipper wrote:
... 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
sc***********@acm.org


Mar 14 '06 #19
On Mon, 13 Mar 2006 02:19:39 GMT
Skipper <mi**@mike.com> wrote:
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
--
Terry Hancock (ha*****@AnansiSpaceworks.com)
Anansi Spaceworks http://www.AnansiSpaceworks.com

Mar 14 '06 #20
Skipper wrote:
Well, thank you so much for taking the time to reply. I guess that
about wraps up all my questions.
You fucking putz


I'd appreciate it if you;d keep that sort of response to yourself. While
I don't mind you *thinking* it, it isn't the kind of behaviour we want
to encourage in these parts, no matter how fatuous you may have found
the response that triggered your profanity.

Thanks
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC/Ltd www.holdenweb.com
Love me, love my blog holdenweb.blogspot.com

Mar 14 '06 #21
Well, Nicholas Chase just posted an OpenLaszlo tutorial/app that shows
how OpenLaszlo handles sounds. Try
http://www-128.ibm.com/developerwork...laszlo1-i.html
You have to register, but it's free, and they don't bug you. It's PHP
driven, but that part's easily ported to Python.

Anyway, there's the basis of an all open-source or freeware application
that animates with sounds.

Ron

Mar 14 '06 #22
I did not check prices earlier. There are many other clones. How about
Hyperstudio? $70 for student edition?

Mar 15 '06 #23
I've knocked together something which may help you to get started. It may
not be the best solution to your problem, but it's based on some code that I
had lying around and it should be easy for you to customise.

It uses a cherrypy server with a web ui. Send me a note with your address
and I'll forward the code on to you (34 KB).

py*********************@spamgourmet.com

Andy
Mar 15 '06 #24

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by A. Wiebenga | last post: by
5 posts views Thread by bojiokia | last post: by
reply views Thread by Anurag | last post: by
5 posts views Thread by Franco, Gustavo | last post: by
1 post views Thread by albert_reade | last post: by
8 posts views Thread by Dynamo | last post: by
reply views Thread by mihailmihai484 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.