473,395 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Move files/directories to Recycle Bin using standard Python libs

I would like to move files and directories to the Recycle Bin on
Windows from Python. I have found some older articles describing how
to do this, but they require additional packages to be installed. I'm
working on a plugin for an existing project and only have the standard
library to work with. Is there a way to use the Recycle Bin using
standard Python?

--
Kevin D. Smith

Aug 15 '07 #1
2 4244
On Aug 15, 11:39 am, Kevin D. Smith <Kevin.Sm...@sas.comwrote:
I would like to move files and directories to the Recycle Bin on
Windows from Python. I have found some older articles describing how
to do this, but they require additional packages to be installed. I'm
working on a plugin for an existing project and only have the standard
library to work with. Is there a way to use the Recycle Bin using
standard Python?

--
Kevin D. Smith
Sounds like a Windows only thing to me, so you'll probably have to use
the win32 package regardless. See the following links:

http://mail.python.org/pipermail/pyt...er/287638.html
http://tgolden.sc.sabren.com/python/...py-a-file.html

Mike

Aug 15 '07 #2
ky******@gmail.com schrieb:
On Aug 15, 11:39 am, Kevin D. Smith <Kevin.Sm...@sas.comwrote:
>I would like to move files and directories to the Recycle Bin on
Windows from Python. I have found some older articles describing how
to do this, but they require additional packages to be installed. I'm
working on a plugin for an existing project and only have the standard
library to work with. Is there a way to use the Recycle Bin using
standard Python?

--
Kevin D. Smith

Sounds like a Windows only thing to me, so you'll probably have to use
the win32 package regardless. See the following links:

http://mail.python.org/pipermail/pyt...er/287638.html
http://tgolden.sc.sabren.com/python/...py-a-file.html
Or access the win32 api directly with ctypes (included in Python 2.5).

Thomas

Aug 15 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: ebobnar | last post by:
I have some code running on windows on my local machine that uses the jpgraph image library. I include the jpgraph libs using include ("C:\Programming\php\jpgraph-1.14\src\jpgraph.php"); I am...
2
by: Mike | last post by:
I am sure that I am making a simple boneheaded mistake and I would appreciate your help in spotting in. I have just installed apache_2.0.53-win32-x86-no_ssl.exe php-5.0.3-Win32.zip...
3
by: Kay Lee | last post by:
Hi, I looked up os module to find out some method to move and copy files in python, but os doesn't support such methods. Is there any way to move & copy files in python? Thanks in adv.
44
by: Xah Lee | last post by:
here's a large exercise that uses what we built before. suppose you have tens of thousands of files in various directories. Some of these files are identical, but you don't know which ones are...
6
by: Sylvain Thenault | last post by:
Hi there ! I've some questions regarding pth files (which btw are undocumented in the python reference, is this intentional ?) I thought that I could use a .pth file to be able to import zope...
10
by: TokiDoki | last post by:
Hello there, I have been programming python for a little while, now. But as I am beginning to do more complex stuff, I am running into small organization problems. It is possible that what I...
1
by: Giap | last post by:
Giap wrote: > *I am writing a program using vc++. Now i need to move the file i > create to other place but i failed to do that. Can anyone pls give me > a hint? * I have fix myself..hehe.. use...
5
by: KraftDiner | last post by:
Hi I need help writing a python script that traverses (recursivly) a directory and its sub directories and processes all files in the directory. So at each directory if there are files in it I...
4
by: Stef Mientki | last post by:
hello, after 4 months playing around with Python, and I still have troubles with egg files. Sometimes it works, sometimes it doesn't. If I google on "python egg", I get lost of links, which...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.