[python-win32] drag&drop files with non-ASCII filenames?
Ulli Horlacher
framstag at rus.uni-stuttgart.de
Tue Dec 15 14:42:20 EST 2015
On Tue 2015-12-15 (11:10), Tim Roberts wrote:
> > I have a python 2.7 program which runs in a console window and upload
> > files.
> > To specify the files, the user uses Windows drag&drop (via explorer) or
> > copy&paste.
>
> This is hopeless. In addition to the normal difficulties in
> string/Unicode conversions, you have the added limitations of the
> current console code page. You simply cannot type characters in a
> Windows console that are not present in your current code page.
What is the current code page?
drag&drop of a file with a non-ASCII filename from the explorer into a
"naked" console window works:
http://fex.rus.uni-stuttgart.de/fop/dLxrxPBV/X-201512152036.png
Is there no way to catch it with Python?
> Your code is also making assumptions about the behavior of the console
> window that are not warranted. No one promised, for example, that a
> string pasted with "paste" is going to fire kbhit() continuously until
> empty.
So far, it works :-)
> > To read it I use:
> >
> > file = get_paste()
>
> It is unwise to use the name of a built-in type as the name of a variable.
Ooops. True.
--
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/
REF:<567065B3.3070306 at probo.com>
More information about the python-win32
mailing list