Re: cannot open file with non-ASCII filename

2015-12-17 Thread Terry Reedy
On 12/18/2015 12:12 AM, bearmingo wrote: Usually I put #!-*-coding=utf-8-*- at each py file. It's ok to open file in local system. That declaration only applies to the content of the file, not its name on the filesystem. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python

cannot open file with non-ASCII filename

2015-12-17 Thread bearmingo
Usually I put #!-*-coding=utf-8-*- at each py file. It's ok to open file in local system. -- https://mail.python.org/mailman/listinfo/python-list

Re: cannot open file with non-ASCII filename

2015-12-16 Thread eryk sun
On Tue, Dec 15, 2015 at 11:04 AM, Ulli Horlacher wrote: > > Ehhh... I started Python programming some weeks ago and I know nearly > nothing about Windows. I am a UNIX and VMS guy :-) You should feel right at home, then. The Windows NT kernel was designed and implemented by a team of former DEC en

Re: cannot open file with non-ASCII filename

2015-12-15 Thread Ulli Horlacher
eryk sun wrote: > pyreadline looked promising for its extensive ctypes implementation of > the Windows console API [1], wrapped by high-level methods such as > peek, getchar, and getkeypress. It turns out it ignores the event > sequences you need for alt+numpad input (used when a file is dragged

Re: cannot open file with non-ASCII filename

2015-12-15 Thread eryk sun
On Tue, Dec 15, 2015 at 2:26 AM, Ulli Horlacher wrote: > Laura Creighton wrote: > >> PyPy wrote its own pyreadline. >> You can get it here. https://bitbucket.org/pypy/pyrepl > > As far as I can see, it has no getkey function. > My users do not hit ENTER after drag&drop or copy&paste files. > I ne

Re: cannot open file with non-ASCII filename

2015-12-15 Thread Laura Creighton
In a message of Tue, 15 Dec 2015 08:26:37 +, Ulli Horlacher writes: >Laura Creighton wrote: > >> PyPy wrote its own pyreadline. >> You can get it here. https://bitbucket.org/pypy/pyrepl > >As far as I can see, it has no getkey function. >My users do not hit ENTER after drag&drop or copy&paste

Re: cannot open file with non-ASCII filename

2015-12-15 Thread Ulli Horlacher
Laura Creighton wrote: > PyPy wrote its own pyreadline. > You can get it here. https://bitbucket.org/pypy/pyrepl As far as I can see, it has no getkey function. My users do not hit ENTER after drag&drop or copy&paste files. I need an input function with a timeout. -- Ullrich Horlacher

Re: cannot open file with non-ASCII filename

2015-12-14 Thread eryk sun
On Mon, Dec 14, 2015 at 6:07 PM, Laura Creighton wrote: > In a message of Mon, 14 Dec 2015 23:41:21 +0100, "Thomas 'PointedEars' Lahn" > wr > ites: > >>Why do you have to use msvcrt? >> >>I would use curses for user input, but: >> >>,-

Re: cannot open file with non-ASCII filename

2015-12-14 Thread Laura Creighton
In a message of Mon, 14 Dec 2015 17:55:04 -0600, eryk sun writes: >On Mon, Dec 14, 2015 at 4:17 PM, Ulli Horlacher > wrote: >> >> ImportError: No module named pyreadline >> >> Is it a python 3.x module? >> >> I am limited to Python 2.7 > >pyreadline is available for 2.7-3.5 on PyPI. Anyway, I tried

Re: cannot open file with non-ASCII filename

2015-12-14 Thread Laura Creighton
In a message of Mon, 14 Dec 2015 23:41:21 +0100, "Thomas 'PointedEars' Lahn" wr ites: >Why do you have to use msvcrt? > >I would use curses for user input, but: > >,- >,-

Re: cannot open file with non-ASCII filename

2015-12-14 Thread eryk sun
On Mon, Dec 14, 2015 at 4:17 PM, Ulli Horlacher wrote: > > ImportError: No module named pyreadline > > Is it a python 3.x module? > > I am limited to Python 2.7 pyreadline is available for 2.7-3.5 on PyPI. Anyway, I tried it to no avail. When dropping a file path into the console it ignores the a

Re: cannot open file with non-ASCII filename

2015-12-14 Thread Thomas 'PointedEars' Lahn
Ulli Horlacher wrote: > Laura Creighton wrote: >> Given that Ulli is in Germany, latin-1 is likely to work fine for him. > > For me, but not for my users. We have people from about 100 nations at our > university. > […] > The problem is the input of these filenames. Why do you have to use msvcr

Re: cannot open file with non-ASCII filename

2015-12-14 Thread Ulli Horlacher
Laura Creighton wrote: > Given that Ulli is in Germany, latin-1 is likely to work fine for him. For me, but not for my users. We have people from about 100 nations at our university. > And you do it like this: > > # -*- coding: latin-1 -*- > from Tkinter import * > root = Tk() > s = 'Välkom

Re: cannot open file with non-ASCII filename

2015-12-14 Thread Laura Creighton
In a message of Mon, 14 Dec 2015 13:34:56 -0500, Terry Reedy writes: >On 12/14/2015 11:24 AM, Ulli Horlacher wrote: >> With Python 2.7.11 on Windows 7 my users cannot open/read files with >> non-ASCII filenames. > >Right. They should either restrict themselves to ascii (or possibly >latin-1) file

Re: cannot open file with non-ASCII filename

2015-12-14 Thread eryk sun
On Mon, Dec 14, 2015 at 10:24 AM, Ulli Horlacher wrote: > With Python 2.7.11 on Windows 7 my users cannot open/read files with > non-ASCII filenames. [...] > c = msvcrt.getch() This isn't an issue with Python per se, and the same problem exists in Python 3, using either getch or getwch. Micro

Re: cannot open file with non-ASCII filename

2015-12-14 Thread Terry Reedy
On 12/14/2015 11:24 AM, Ulli Horlacher wrote: With Python 2.7.11 on Windows 7 my users cannot open/read files with non-ASCII filenames. Right. They should either restrict themselves to ascii (or possibly latin-1) filenames or use current 3.x. This is one of the (known) unicode problems fixe

cannot open file with non-ASCII filename

2015-12-14 Thread Ulli Horlacher
With Python 2.7.11 on Windows 7 my users cannot open/read files with non-ASCII filenames. They use the Windows explorer to drag&drop files into a console window running the Python program. os.path.exists() does not detect such a file and an open() fails, too. My code: print("\nDrag&drop files