How to deal folder during drag&drop in wxPython?

Hi, guys,

I’d like to drag&drop a folder into the application based on wxPython. I want to pick out all the files this folder have by os.walk(). After dropping, my application figure out that the folder as a file. So, How to let the application know it’s a folder not a file?

Thanks!

···

gaohawk

2007-10-16

The FileDropTarget receives a list of filenames. Just check if that list has one element and then use os.path.isdir() to figure out if it is a directory.

Peter

···

On 10/16/07, gaohawk gaohawk@gmail.com wrote:

Hi, guys,

I’d like to drag&drop a folder into the application based on wxPython. I want to pick out all the files this folder have by os.walk(). After dropping, my application figure out that the folder as a file. So, How to let the application know it’s a folder not a file?

Thanks!


gaohawk

2007-10-16


There is NO FATE, we are the creators.