input: Drag/Drop several directories (multiline)?

I'm asking the user to input as many directory-paths as he wants, something like this:

allPaths = []
while True:
  path = raw_input('bla')
  if validatePath(path):
    allPaths.append(path)
  else:
    break

Right now, the user selects multiple folders, makes a Shift+Rightclick on it in Windows and uses "Copy Paths", which will give him a list of directories, like this:

"C:UsersxxDesktoptest"
"C:UsersxxDesktoptest2"

by inserting this using Mouse rightclick into the CMD Window, it will be accepted by raw_input as several single lines, ie with every linebreak, raw_input() will end, run ValidatePaths and take the next line.

Now what I want to achieve is that it should be possible to Drag/Drop multiple directories directly on the CMD Window / running script with the same outcome.

Right now, what happens when dropping multiple Directories: It just enters the path to the first directory into the raw_input(), but doesn't continue, because probably the drag/drop will not have a new linefeed hence the raw_input keeps waiting. Is there any way to change this hebaviour for my Python Executable (Pyinstaller exe) or would that be up to CMD, hence cannot be changed for me?

Thanks

链接地址: http://www.djcxy.com/p/56502.html

上一篇: django视图函数返回后运行的代码

下一篇: 输入:拖放多个目录(多行)?