How to move a file to trash with out using shell and shellcon modules

Hi All,

inorder to move a file to the trash we use

shell.SHFileOperation((0, shellcon.FO_DELETE, 'somefilename', None,
shellcon.FOF_ALLOWUNDO|shellcon.FOF_NOCONFIRMATION ))

This shell and shellcon modules are from pywin32.exe.

i want to move file to trash with out using shell and shellcon modules

IS there any alternative way?

               (OR)

IS there any wx method to do the same task?

I would appreciate your help

Thanks

If you are just wanting to reduce the number of dependencies then you can access the same APIs with ctypes, which is included with Python now.

···

On 6/3/10 12:21 AM, steave waugh wrote:

Hi All,

  inorder to move a file to the trash we use

shell.SHFileOperation((0, shellcon.FO_DELETE, 'somefilename', None,
shellcon.FOF_ALLOWUNDO|shellcon.FOF_NOCONFIRMATION ))

This shell and shellcon modules are from pywin32.exe.

i want to move file to trash with out using shell and shellcon modules

IS there any alternative way?

--
Robin Dunn
Software Craftsman

Hi,

···

On Thu, Jun 3, 2010 at 11:49 AM, Robin Dunn <robin@alldunn.com> wrote:

On 6/3/10 12:21 AM, steave waugh wrote:

Hi All,

inorder to move a file to the trash we use

shell.SHFileOperation((0, shellcon.FO_DELETE, 'somefilename', None,
shellcon.FOF_ALLOWUNDO|shellcon.FOF_NOCONFIRMATION ))

This shell and shellcon modules are from pywin32.exe.

i want to move file to trash with out using shell and shellcon modules

IS there any alternative way?

If you are just wanting to reduce the number of dependencies then you can
access the same APIs with ctypes, which is included with Python now.

In Editra we use cytpes to do this for an implementation using ctypes
see: Google Code Archive - Long-term storage for Google Code Project Hosting..

Cody