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

Re: [pygame] Getting input from command line



> Does anybody know the best way to get input from the command line?
> Specifically space and escape.
>
> I have my program doing things in a thread and constantly reporting
> information. I'd like the main thread to be able to pause and unpause the
> other thread on space and to quit program cleanly with escape.
>
> I tried using Curses, but it didn't work out too well. I got the input
> great, but I came across problems when adding strings that went off screen
> (lol). Rather than try to fix this I finally decided that I didn't want to
> use Curses since it can't run on Windows.
>
> Am I getting into the realm of GUI software here simply by wanting input
> from space and escape? I just wanted something I could start in a terminal
> and forget about really.
>
> Does anyone have any ideas?
>
> Thanks,
> Fiona

I think I must be missing something. Why don't you just use pygame keys?

http://www.pygame.org/docs/ref/key.html

-- 
Douglas E Knapp

http://sf-journey-creations.wikispot.org/Front_Page