Re: cross platform alternative for signal.SIGALRM?

2015-11-11 Thread Ulli Horlacher
Marko Rauhamaa wrote: > I'm thinking the only portable way is to run a watchdog process with > subprocess or multiprocessing. How can a subprocess interrupt a function in another process? For example: waiting for user input with a timeout. raw_input("Hit ENTER to continue or wait 10 s") --

non-blocking getkey?

2015-11-18 Thread Ulli Horlacher
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 w

Re: non-blocking getkey?

2015-11-18 Thread Ulli Horlacher
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's usually hacky (stty on Linux,

Re: non-blocking getkey?

2015-11-18 Thread 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 tkFileDialog import askope

Re: non-blocking getkey?

2015-11-18 Thread Ulli Horlacher
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

Re: non-blocking getkey?

2015-11-18 Thread Ulli Horlacher
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

Re: non-blocking getkey?

2015-11-18 Thread Ulli Horlacher
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/ >

handling of non-ASCII filenames?

2015-11-18 Thread Ulli Horlacher
I have written a program (Python 2.7) which reads a filename via tkFileDialog.askopenfilename() (was a good hint here, other thread). This filename may contain non-ASCII characters (German Umlauts). In this case my program crashes with: File "S:\python\fexit.py", line 1177, in url_encode

Re: non-blocking getkey?

2015-11-18 Thread Ulli Horlacher
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 callin

Re: handling of non-ASCII filenames?

2015-11-18 Thread Ulli Horlacher
Chris Angelico wrote: > > As I am Python newbie I have not quite understood the Python character > > encoding scheme :-} > > > > Where can I find a good introduction of this topic? > > Here are a couple of articles on the basics of Unicode: > > http://www.joelonsoftware.com/articles/Unicode.htm

Re: handling of non-ASCII filenames?

2015-11-18 Thread Ulli Horlacher
Chris Angelico wrote: > >> If you can use Python 3 > > > > I cannot use it, because the Python compiler pyinstaller does not work > > with it on Windows: > > > > S:\python>pyinstaller.exe --onefile tk.py > > Traceback (most recent call last): > > File "C:\Python35\Scripts\pyinstaller-script.py"

pyinstaller and Python 3.5 on Windows?

2015-11-18 Thread Ulli Horlacher
To run my Python programs on other Windows systems without a Python installation I must create standalone Windows executables. pyinstaller runs without any problems with Python 2.7.10 on Windows 7, but with Python 3.5 I get: S:\python>pyinstaller.exe --onefile tk.py Traceback (most recent call la

Re: pyinstaller and Python 3.5 on Windows?

2015-11-18 Thread Ulli Horlacher
Christian Gollwitzer wrote: > Am 18.11.15 um 23:46 schrieb Ulli Horlacher: > > To run my Python programs on other Windows systems without a Python > > installation I must create standalone Windows executables. > > > > pyinstaller runs without any problems with Pyth

Re: handling of non-ASCII filenames?

2015-11-19 Thread Ulli Horlacher
Christian Gollwitzer wrote: > Am 18.11.15 um 17:45 schrieb Ulli Horlacher: > > This is my encoding function: > > > > def url_encode(s): > >u = '' > >for c in list(s): > > if match(r'[_=:,;<>()+.\w\-]',c): > >

Re: pyinstaller and Python 3.5 on Windows?

2015-11-19 Thread Ulli Horlacher
Kevin Walzer wrote: > I understand that Python 3.5 has shipped how the MS dll's from Visual > Studio are shipped, and perhaps the freezing tools (pyinstaller, py2exe) > haven't yet caught up. Consider filing a bug with the pyinstaller > developers. http://pythonhosted.org/PyInstaller/#windows

Re: pyinstaller and Python 3.5 on Windows?

2015-11-19 Thread Ulli Horlacher
Ulli Horlacher wrote: > C:\Users\admin>pip install pypiwin32 > Collecting pypiwin32 > Downloading pypiwin32-219-cp35-none-win32.whl (7.9MB) > 100% || 7.9MB 61kB/s > Installing collected packages: pypiwin32 > Exception: (...) > Pe

Re: non-blocking getkey?

2015-11-19 Thread Ulli Horlacher
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() > >>

Re: non-blocking getkey?

2015-11-23 Thread Ulli Horlacher
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

Linux/Windows GUI programming: tk or wx?

2017-08-04 Thread Ulli Horlacher
I have to transfer a python 2.7 CLI programm into one with a (simple) GUI. The program must run on Linux and Windows and must be compilable with pyinstall, because I have to ship a standalone windows.exe Any kind of installer is not acceptable. Reading https://github.com/pyinstaller/pyinstaller/wi

<    1   2