Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #91987
| Path | csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <gherron@digipen.edu> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.061 |
| X-Spam-Evidence | '*H*': 0.88; '*S*': 0.00; 'python,': 0.02; 'installed.': 0.05; 'seemed': 0.07; 'confuse': 0.09; 'module)': 0.09; 'scripting': 0.09; 'suggestions.': 0.09; 'python': 0.11; 'curses': 0.16; 'giu': 0.16; 'i.e.,': 0.16; 'return,': 0.16; 'set- up': 0.16; 'wrote:': 0.16; 'beginner': 0.18; 'language': 0.19; 'windows': 0.20; 'planet': 0.22; 'am,': 0.23; 'help.': 0.23; 'module': 0.23; 'elements': 0.23; 'errors': 0.23; 'nearly': 0.23; 'header:In-Reply-To:1': 0.24; 'install': 0.25; 'header:User- Agent:1': 0.26; 'installed': 0.26; 'connected': 0.27; 'not,': 0.27; 'not.': 0.27; 'url:moin': 0.27; "doesn't": 0.28; 'device': 0.29; 'interface': 0.29; 'other,': 0.29; 'url:wiki': 0.30; 'window': 0.31; 'anyone': 0.32; 'framework': 0.32; 'point': 0.33; 'url:python': 0.33; 'third': 0.33; 'interface,': 0.33; 'to:addr :python-list': 0.35; 'propose': 0.35; 'question,': 0.35; 'knowledge': 0.35; 'something': 0.35; 'really': 0.35; 'but': 0.36; 'url:org': 0.36; 'possible': 0.36; 'basic': 0.36; 'guidance': 0.36; 'should': 0.37; 'received:10': 0.37; 'subject:: ': 0.37; 'level': 0.37; 'button': 0.38; 'thank': 0.39; 'to:addr:python.org': 0.39; 'seem': 0.39; 'where': 0.40; 'some': 0.40; 'your': 0.60; 'press': 0.61; 'john': 0.61; 'research': 0.62; 'more': 0.62; 'url:%20': 0.63; 'you.': 0.64; 'within': 0.64; 'places': 0.64; 'due': 0.65; 'charset:windows-1252': 0.65; 'url:%1': 0.66; 'dr.': 0.69; 'received:204': 0.75; 'received:10.10': 0.76; 'saw': 0.76; 'institute': 0.77; '(425)': 0.84; '895-4418': 0.84; 'action.': 0.84; 'digipen': 0.84; 'herron': 0.84; 'interaction.': 0.84; 'unclear': 0.84; 'url:guiprogramming': 0.84; 'choice.': 0.93 |
| Date | Wed, 03 Jun 2015 12:15:32 -0700 |
| From | Gary Herron <gherron@digipen.edu> |
| User-Agent | Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 |
| MIME-Version | 1.0 |
| To | python-list@python.org |
| Subject | Re: Keypress Input |
| References | <rBHbx.75089$MO7.40532@fx10.iad> |
| In-Reply-To | <rBHbx.75089$MO7.40532@fx10.iad> |
| Content-Type | text/plain; charset=windows-1252; format=flowed |
| Content-Transfer-Encoding | 7bit |
| X-Mailman-Approved-At | Wed, 03 Jun 2015 21:29:20 +0200 |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.20+ |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.123.1433359762.13271.python-list@python.org> (permalink) |
| Lines | 58 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1433359762 news.xs4all.nl 2947 [2001:888:2000:d::a6]:45833 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:91987 |
Show key headers only | View raw
On 06/03/2015 11:22 AM, John McKenzie wrote:
> Hello.
>
> Very new to Python and looking for some basic help.
>
> Would like a set-up where something happens when a key is pressed. Not
> propose a question, have the user type something, then hit return, then
> something happens, but just the R key is pressed, something happens, then
> something else happens if the B key is pressed, then a third thing
> happens if the G key is pressed.
>
> My research only served to confuse me. Firstly, I do not understand how
> it is possible for this to be a difficult thing not built into the system
> for any scripting language made within the last few decades. More to the
> point I am unclear on specific suggestions. Most of them seem to be for
> Windows only and I want this working on a Raspberry Pi. Saw getch but I
> am still confused if it is platform specific or not, or requires a module
> to be installed or not. Just get errors if I try to install getch using
> PIP.
If you are using Python through a CLI (command line interface i.e., a
shell), then in fact your request doesn't really make sense. CLIs by
their nature don't support that kind of interaction.
BUT don't despair. Nearly every GIU framework on the planet has a
Python interface, and they all allow for a window to be opened with
event processing of your choice.
This are some good places to start:
https://wiki.python.org/moin/GuiProgramming
https://wiki.python.org/moin/GUI%20Programming%20in%20Python
Several of these (Tkinter and the curses module) are distributed with
Python, so you should already have them installed.
Gary Herron
>
> Other suggestions seemed to be overkill and confused me to due to my
> beginner level knowledge and the fact these suggestions have other, more
> complicated elements to them.
>
> I just want a button press on a device connected to a Raspberry Pi to
> trigger an action. If anyone can give me some guidance on this I would
> appreciate it.
>
> Thank you.
>
--
Dr. Gary Herron
Department of Computer Science
DigiPen Institute of Technology
(425) 895-4418
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Keypress Input John McKenzie <davros@bellaliant.net> - 2015-06-03 18:22 +0000
Re: Keypress Input Laura Creighton <lac@openend.se> - 2015-06-03 20:59 +0200
Re: Keypress Input Gary Herron <gherron@digipen.edu> - 2015-06-03 12:15 -0700
Re: Keypress Input Gary Herron <gherron@digipen.edu> - 2015-06-03 11:47 -0700
Re: Keypress Input Laura Creighton <lac@openend.se> - 2015-06-04 12:50 +0200
Re: Keypress Input John McKenzie <davros@bellaliant.net> - 2015-06-06 18:28 +0000
Re: Keypress Input Laura Creighton <lac@openend.se> - 2015-06-06 22:52 +0200
Re: Keypress Input Chris Angelico <rosuav@gmail.com> - 2015-06-07 07:20 +1000
Re: Keypress Input Michael Torrie <torriem@gmail.com> - 2015-06-06 22:31 -0600
Re: Keypress Input John McKenzie <davros@bellaliant.net> - 2015-06-15 05:15 +0000
Re: Keypress Input John McKenzie <davros@bellaliant.net> - 2015-06-16 15:09 +0000
Re: Keypress Input Christian Gollwitzer <auriocus@gmx.de> - 2015-06-19 07:20 +0200
Re: Keypress Input John McKenzie <davros@bellaliant.net> - 2015-06-20 14:59 +0000
Re: Keypress Input Rick Johnson <rantingrickjohnson@gmail.com> - 2015-07-15 18:03 -0700
Re: Keypress Input Michael Torrie <torriem@gmail.com> - 2015-07-15 22:30 -0600
Re: Keypress Input Rick Johnson <rantingrickjohnson@gmail.com> - 2015-07-16 10:22 -0700
Re: Keypress Input Michael Torrie <torriem@gmail.com> - 2015-07-16 15:27 -0600
Re: Keypress Input Terry Reedy <tjreedy@udel.edu> - 2015-07-16 02:08 -0400
Re: Keypress Input Rick Johnson <rantingrickjohnson@gmail.com> - 2015-07-16 11:30 -0700
Re: Keypress Input Terry Reedy <tjreedy@udel.edu> - 2015-07-16 03:10 -0400
Re: Keypress Input Michael Torrie <torriem@gmail.com> - 2015-07-16 15:29 -0600
Re: Keypress Input John McKenzie <davros@bellaliant.net> - 2015-06-15 05:23 +0000
Re: Keypress Input Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2015-06-15 12:22 +0100
Re: Keypress Input Grant Edwards <invalid@invalid.invalid> - 2015-06-15 15:22 +0000
Re: Keypress Input Michael Torrie <torriem@gmail.com> - 2015-06-16 11:15 -0600
Re: Keypress Input John McKenzie <davros@bellaliant.net> - 2015-06-16 20:06 +0000
Re: Keypress Input Grant Edwards <invalid@invalid.invalid> - 2015-06-16 20:49 +0000
Re: Keypress Input Michael Torrie <torriem@gmail.com> - 2015-06-16 19:22 -0600
Re: Keypress Input Michael Torrie <torriem@gmail.com> - 2015-06-18 16:42 -0600
Re: Keypress Input John McKenzie <davros@bellaliant.net> - 2015-06-20 15:02 +0000
Re: Keypress Input Michael Torrie <torriem@gmail.com> - 2015-06-20 10:30 -0600
Re: Keypress Input Paul Rubin <no.email@nospam.invalid> - 2015-06-16 14:22 -0700
Re: Keypress Input John McKenzie <davros@bellaliant.net> - 2015-07-15 19:05 +0000
Re: Keypress Input Michael Torrie <torriem@gmail.com> - 2015-07-15 13:17 -0600
Re: Keypress Input John McKenzie <davros@bellaliant.net> - 2015-08-16 19:45 +0000
csiph-web