[Tutor] Intro

Emile van Sebille emile at fenx.com
Mon Aug 29 23:36:02 CEST 2011

On 8/29/2011 11:29 AM Cranky Frankie said...
> I'm trying to decide what would be better:

'better' is subjective.  On the one hand, you have a monolithic python 
program that consolidates data and program into a single source; on the 
other hand, you have separation of logic and data.

Most often, and particularly for larger on-going projects, I'll use the 
second approach as the infrastructure to support it is already in place.

However, I am rather fond of certain monolithic solutions as both 
maintenance and deployment are much easier.  TiddlyWiki and Monmotha's 
firewall script come to mind.

> - reading the huge quote file (hundreds of entries, two strings,
> author and quotation) in each time the program starts
> - loading the quotes into an array in the program

I don't imagine you'd see much difference here.  The content must be 
read from disk and organized in a python structure regardless.

> I'd like to be able to add new quotes easily, so that is a factor as well.
> I'm satisfied to use a dialog box, I don't need a GUI at this point so
> no tkinter (yet).

There's not much difference either in the 'launch a program' or 'load a 
program' approaches to adding quotes.

For learning purposes, I think I'd advise a complete newbie to start 
with the monolithic approach and build up and out from there.


More information about the Tutor mailing list