[Tutor] Deleting specified files using a python program...helpwith code?]

Alan Gauld alan.gauld at btinternet.com
Tue Jul 1 14:19:44 CEST 2008


"W W" <srilyk at gmail.com> wrote

> Testing your example, Alan, you have it defaulted to "delete",
> correct? That's where the "not confirmation" part comes in? I just
> tried it in a simple function:

Correct. Purely an arbitrary choice.

> def confirm(iput):  #I wasn't sure if input was "reserved"

input is a builtin function so you can use the name OK
but it will hide the function so is not a good idea.

> That's something I didn't expect at first, mainly because I'm not 
> used
> to setting up that sort of input (but it makes sense to do it that
> way).

Its just another form of user friendliness.
Actually I wouldn't use a default approach on anything thats 
potentially
destructive - like deleting files - but for other applications its a 
useful
device.

-- 
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