[Tutor] Newbie to Python

Alan Gauld alan.gauld at btinternet.com
Sun Dec 9 09:46:44 CET 2007


Hi Fred,

welcome to the list

> I would like to provide the script the path and filename of a file.

OK, Look at sys.argv for command line argument passing
Look at raw_input() for interactive prompting

> Then the script would create a series of required directories
> then copy the contents of the provided folder into the destination
> location + series of required directories

Look at the os module for lots of stuff around handling files.
In particular look at the os.path module and the shutil module.

> It doesn't seem to terribly difficult, and I think i could get this
> same functionality done in something other than python, but I would
> love to try and start off with something like this.

It's a perfectly valid starting point. Have a go, and ask here
if/when you hit problems.

You might find the  "Using the OS" topic in my tutorial useful
as a starter.

-- 
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld 




More information about the Tutor mailing list