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

Kent Johnson kent37 at tds.net
Sat Jul 15 13:31:41 CEST 2006


Bobby J. Howerton Jr. wrote:
>
> 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.
>
Yes, it's possible. Python includes modules that can help you search the 
file system, create zip files and send emails with attachments. (The os, 
zipfile, email and smtplib modules.)
>
>
> If this is possible…How would I do this (please remember that I am new 
> to Programming in Python).
>
You need to walk before you can run. Pick a Python tutorial and work 
through it to learn the basics of the language. Then work on each piece 
of the problem. Searching for files is pretty easy, zipping folders is a 
little harder, creating and sending the email a little more complex. 
None of them are really hard but you need to understand the language first.

You don't say if you have any programming background. Take a look at one 
of these pages for a suitable tutorial:
http://wiki.python.org/moin/BeginnersGuide/NonProgrammers
http://wiki.python.org/moin/BeginnersGuide/Programmers

Try stuff out. Ask here when you get stuck. And welcome to Python!

Kent



More information about the Tutor mailing list