[PythonCE] kbhit type of functionality in PythonCE

Adam Walley adam.walley at gmail.com
Thu Oct 29 21:42:46 CET 2009

Hi, Cazaw.

Welcome to PythonCE. I remember wrestling with similar issues with the
raw_input. AFAIK its features are very limited and it does rather awkwardly
appear over the PythonCE window. You can, of course, position your text
output with some spacing.

If you are satisfied with just a pause before the raw_input window appears
then you can import the time module and use the sleep function (although
this tends to make the OS think the app is not responding). I usually create
a simple loop function instead, when using this method. It would define a
pause function and look something like this:

def pause(t):
   while time.time()-t0<t:

where 't' is the number of seconds to pause (and can be a decimal if
needed). Then you just call the pause function at the point in your code
where you want to wait.

Unfortunately, I think that any other method whereby (hard or soft) key or
stylus input is used would be non-trivial and requires quite a bit more

If you have the time to put into it, I would suggest looking into the
PocketPyGUI package or compiling the SDL library and using that (I have some
info on using SDL with PythonCE here: watersprite.awardspace.com/python).
Perhaps other list members have some other suggestions?

2009/10/29 Cazaw <cazaw_wow at yahoo.com>

> p.s. - Alternately, if the raw_input could show up in the stdout along with
> the displayed results instead of it's own dialog box, that would be just
> fine and eliminate the problem. Whichever way would be easiest.
> --
> View this message in context:
> http://www.nabble.com/kbhit-type-of-functionality-in-PythonCE-tp26114814p26119052.html
>  Sent from the Python - pythonce mailing list archive at Nabble.com.
> _______________________________________________
> PythonCE mailing list
> PythonCE at python.org
> http://mail.python.org/mailman/listinfo/pythonce
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pythonce/attachments/20091029/2a1905da/attachment.htm>

More information about the PythonCE mailing list