[Tutor] How to get script to detect whether a file exists?

Alan Gauld alan.gauld at btinternet.com
Tue Aug 3 01:55:56 CEST 2010

"Richard D. Moores" <rdmoores at gmail.com> wrote

> By golly, you're right! Your point led to changes in 4 lines, the 
> ones
> highlighted: <http://tutoree7.pastebin.com/xDUfUAET>

Its a Good Thing(TM) to keep your interface specs consistent so
I'd change the order of the parameters in repickling() to match
those in create_pickle_file()

For bonus points create a PickleFile class that has dump(),
load() and repickle() methods - and uses __init__() for create 
The class can store the file name for convenience.


Alan Gauld
Author of the Learn to Program web site

More information about the Tutor mailing list