non-blocking getkey?
Ulli Horlacher
framstag at rus.uni-stuttgart.de
Wed Nov 18 03:39:19 EST 2015
In my program (for python 2.7) the user must enter file names with
mouse copy+paste. I use:
while True:
file = raw_input(prompt)
if file == '': break
files.append(file)
The problem now is: my users do not hit ENTER after pasting.
The file names are pasted together in one single line without space or
other delimiter.
My idea now is: instead of raw_input() I use a get_paste() function, which
reads input character for input character and after a (say) 1 s timeout it
returns the string. Pasting a string with the mouse is rather fast, there
should be no big delay between the characters.
How can I implement such a get_paste() function?
I need a non-blocking getkey() function.
It must work on Windows and Linux.
--
Ullrich Horlacher Server und Virtualisierung
Rechenzentrum IZUS/TIK E-Mail: horlacher at tik.uni-stuttgart.de
Universitaet Stuttgart Tel: ++49-711-68565868
Allmandring 30a Fax: ++49-711-682357
70550 Stuttgart (Germany) WWW: http://www.tik.uni-stuttgart.de/
More information about the Python-list
mailing list