473,326 Members | 2,133 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,326 software developers and data experts.

Needing to create a program that will search my hard drive for certain folders

Hello,
I am new to programming in Python, but I am very excited about the possibilities that it (Python) has.

I maybe jumping the gun a little bit here, but this is what I would like to do:
************************************************** ******************************************

I would like to create an executable program that when ran it will search my hard drive for certain folders that contain different files. Once the program finds these folders, I would like the program to zip each of the folders up and then e-mail each of the folders to a certain e-mail address.

************************************************** ******************************************
Is this possible??? I have been told by someone else that it is…I just want to make sure.

If this is possible…How would I do this (please remember that I am new to Programming in Python).

Thanks for all of the help.

BHowerton
Jul 11 '06 #1
1 2509
hamstu
2
It's very possible.

I won't write out a full program, but here's a basic outline.

First, you'll need to import os to help you with all the path and directory stuff.

Next, you'll want to call os.walk on a directory, this will allow you to (recursively) get the name of each file/folder and process the ones you want, e.g., adding them to a list.

So let's suppose you've ran os.walk, and you now have a list with the folder's you want to zip. To zip these folders files, checkout the zipfile Module.

Basically you'll have to create a ZipFile object for each folder in your list, then loop through each file in these folders adding them to the zip (ZipFile.write)... you might have to use os.walk for that too.

Good luck! :cool:
Jul 12 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

17
by: los | last post by:
Hi, I'm trying to create a program similar to that of Google's desktop that will crawl through the hard drive and index files. I have written the program and as of now I just put the thread to...
3
by: Kevin P. | last post by:
All, I need some help. I need to execute a GUI via a web page sent to a client and pass it 2 arguments. I have been searching the newsgroups to get a clue on how to do this. Essentially, I...
5
by: David Webb | last post by:
The problem started when the Working Folder for a project was somehow set to the folder of another project. I set the correct working folder in VSS and deleted the .vbproj files that had been...
7
by: dog | last post by:
I've seen plenty of articles on this topic but none of them have been able to solve my problem. I am working with an Access 97 database on an NT4.0 machine, which has many Access reports. I...
0
by: Niyazi | last post by:
Hi, I created application that store the data in SQL SERVER that reside on network. The client also use this application to access the resources provided with application. But is the client want...
13
by: Ray Muforosky | last post by:
Hello all: Task: I want to do file search, using the "conatining text" option from a web page. How do I search for a file on my local drive containing a certain string, from a web page. That...
34
by: Tom | last post by:
I'd greatly appreciate advice and code snippets on how to create a ram disk within a C/C++ program. I also need to be able to determine the free space. Thanks in advance for any help.
0
by: SeanEByrne | last post by:
Hi everybody, i have a bit of java programming knowledge but i'd like to find a way how to write a program that searchs a drive for files of a certain type and of a certain size?? I mainly need help...
5
by: Justin Fancy | last post by:
Hi Everyone, I am developing a file aging program that will eventually report on every folder that is in the root directory. I have a list of requested years, and counters set up to count every...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.