Ulli Horlacher wrote:
> The first byte of an escape sequence (example: ^[[21~ for F10) is
> recognized, but the trailing bytes then are not discarded by
> clear_keyboard_buffer() and get_key() returns the second byte of the
> escape sequence.
I have found a solution:
def clear_keyboard_buffer()
I have an application which runs on Windows and UNIX where I need to get
one keypress from the user (without ENTER).
Keys which sends escape sequences (e.g. cursor or function keys) should be
ignored.
I have a solution for Windows, but not for UNIX:
The first byte of an escape sequence (example:
between the characters.
>
> How can I implement such a get_paste() function?
> I need a non-blocking getkey() function.
I found a solution for Windows:
print("\nCopy&paste a filename or drag&drop a file into this window")
file = get_paste()
print('\n"%s
Christian Gollwitzer wrote:
> Another cheap solution comes to mind: On windows, dropping files onto an
> icon on the desktop is interpreted as "launch the program with
> additional arguments", where the arguments are the file names.
Ohhh... great! This helps me a lot!
> Maybe you could try i
Christian Gollwitzer wrote:
> > My users do not like it :-(
> > They want to drag&drop files.
> > Therefore I have added it as another option to enter files:
> >
> > [f] select a file
> > [d] select a directory
> > [e] enter a file or directory (with drag&drop or copy&paste)
>
Am 10.12.15 um 09:28 schrieb Ulli Horlacher:
Ulli Horlacher wrote:
My users do not like it :-(
They want to drag&drop files.
Another cheap solution comes to mind: On windows, dropping files onto an
icon on the desktop is interpreted as "launch the program with
additional arguments", where th
pasting.
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 s
. 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
Rechenze
Ulli Horlacher wrote:
> eryksun wrote:
> > On Thu, Nov 19, 2015 at 10:31 AM, Michael Torrie wrote:
> > > One windows it might be possible to use the win32 api to enumerate the
> > > windows, find your console window and switch to it.
> >
> > You can call GetConsoleWindow [1] and then SetForegro
eryksun wrote:
> On Thu, Nov 19, 2015 at 10:31 AM, Michael Torrie wrote:
> > One windows it might be possible to use the win32 api to enumerate the
> > windows, find your console window and switch to it.
>
> You can call GetConsoleWindow [1] and then SetForegroundWindow [2].
(...)
Sorry, for th
On Thu, Nov 19, 2015 at 10:31 AM, Michael Torrie wrote:
> One windows it might be possible to use the win32 api to enumerate the
> windows, find your console window and switch to it.
You can call GetConsoleWindow [1] and then SetForegroundWindow [2].
import os
import sys
try:
On 11/19/2015 08:48 AM, Ulli Horlacher wrote:
>
> The focus is moved to another, unrelated window, but not back to the
> window in which the python scripts run.
> Same behaviour on Linux (XFCE) and windows 7.
That's because an app that communicates with standard in and standard
out could be runn
Terry Reedy wrote:
> On 11/18/2015 11:50 AM, Ulli Horlacher wrote:
> > Ulli Horlacher wrote:
> >
> >> from Tkinter import Tk
> >> from tkFileDialog import askopenfilename
> >>
> >> Tk().withdraw()
> >> file = askopenfilename()
> >
> > I found another glitch:
>
On Wed, Nov 18, 2015 at 3:14 AM, Christian Gollwitzer wrote:
> The standard terminal on Windows is very ugly, can't resize the width, and
> pasting works only if you right-click -> paste.
The console UI is improved in Windows 10:
http://blogs.windows.com/buildingapps/2014/10/07/console-improvemen
On 11/18/2015 11:50 AM, Ulli Horlacher wrote:
Ulli Horlacher wrote:
from Tkinter import Tk
from tkFileDialog import askopenfilename
Tk().withdraw()
file = askopenfilename()
I found another glitch:
After termination of askopenfilename() the window focus i
Ulli Horlacher wrote:
> from Tkinter import Tk
> from tkFileDialog import askopenfilename
>
> Tk().withdraw()
> file = askopenfilename()
I found another glitch:
After termination of askopenfilename() the window focus is not returned to
the calling window (xterm
Ulli Horlacher writes:
> Steven D'Aprano wrote:
>
>> >> The limitation is that this will not work if any of the file names
>> >> contain astral (non-BMP) chars because tk cannot handle such
>> >> characters.
>> >
>> > What are "astral chars"?
>>
>> Unicode characters beyond U+.
>
> I see, for
On Thu, Nov 19, 2015 at 12:51 AM, Ulli Horlacher
wrote:
> Steven D'Aprano wrote:
>
>> >> The limitation is that this will not work if any of the file names
>> >> contain astral (non-BMP) chars because tk cannot handle such characters.
>> >
>> > What are "astral chars"?
>>
>> Unicode characters be
Chris Angelico wrote:
> > In my application the user MUST select files and directories (in one go).
>
> It's extremely uncommon to be able to select a combination of files
> and directories.
I have an uncommon application :-)
Filetransfer of ANY size: http://fex.rus.uni-stuttgart.de:8080/
>
Steven D'Aprano wrote:
> >> The limitation is that this will not work if any of the file names
> >> contain astral (non-BMP) chars because tk cannot handle such characters.
> >
> > What are "astral chars"?
>
> Unicode characters beyond U+.
I see, for very exotic character sets, like Klingo
On Thu, 19 Nov 2015 12:06 am, Ulli Horlacher wrote:
> Terry Reedy wrote:
>
>> > from Tkinter import Tk
>> > from tkFileDialog import askopenfilename
>> >
>> > Tk().withdraw()
>> > file = askopenfilename()
>>
>> To get multiple names, add 's'.
>
> I have found it already
On Thu, Nov 19, 2015 at 12:06 AM, Ulli Horlacher
wrote:
>> The limitation is that this will not work if any of the file names
>> contain astral (non-BMP) chars because tk cannot handle such characters.
>
> What are "astral chars"?
Characters not on the Basic Multilingual Plane (BMP). The Unicode
Terry Reedy wrote:
> > from Tkinter import Tk
> > from tkFileDialog import askopenfilename
> >
> > Tk().withdraw()
> > file = askopenfilename()
>
> To get multiple names, add 's'.
I have found it already, thanks.
> The limitation is that this will not work if any of t
On 11/18/2015 6:01 AM, Ulli Horlacher wrote:
Ulli Horlacher wrote:
it is too complicated to rewrite my application from CLI to GUI.
But... is there a windows program with which one can select files and the
result is written to STDOUT?
Found it:
from Tkinter import Tk
from tk
Am 18.11.15 um 12:01 schrieb Ulli Horlacher:
Ulli Horlacher wrote:
it is too complicated to rewrite my application from CLI to GUI.
But... is there a windows program with which one can select files and the
result is written to STDOUT?
Found it:
from Tkinter import Tk
from tk
Ulli Horlacher wrote:
> it is too complicated to rewrite my application from CLI to GUI.
> But... is there a windows program with which one can select files and the
> result is written to STDOUT?
Found it:
from Tkinter import Tk
from tkFileDialog import askopenfilename
Christian Gollwitzer wrote:
> > How can I implement such a get_paste() function?
> > I need a non-blocking getkey() function.
> > It must work on Windows and Linux.
>
> Non-blocking I/O from the commandline is OS specific. There are
> different solutions, and it
n-blocking getkey() function.
It must work on Windows and Linux.
Non-blocking I/O from the commandline is OS specific. There are
different solutions, and it's usually hacky (stty on Linux, Console API
on Windows)
Why do you not use a proper GUI toolkit to do this? It is
straight-fo
etween 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: horlac...@tik.uni-stuttgart.de
Universitaet
29 matches
Mail list logo