[Tutor] Documentation and top matter

Alan Gauld alan.gauld at btinternet.com
Sun Jan 4 22:55:02 CET 2009


"wormwood_3" <wormwood_3 at yahoo.com> wrote

> #!/usr/bin/env python
> #-----------------------------------------------------------------------------
> """
> My awesome purpose.
> """
> author = "My Name"
> date_started = "2001-01-01"
> version = 0.1
> #-----------------------------------------------------------------------------
> IMPORT STUFF
> REST OF CODE
>
> This format is still readable and distinct, but by putting the 
> information into attributes,
> they are accessible in an interpreter,

Neat I hadn't thought of that.

The other thing thats often useful is to use your version control tool 
to insert
the keystrings for you. They virtually all have similar features for 
auto-insertting
the version number, filename, update comments and dates.
For example in SCCS ( I know, but I had the docs handy! :-):

%M% = Module name
%R% - Release Number
%L% - Level number
%E% - Date newest delta was created
etc etc.

I don't use SVN but I'm sure it will have similar capabilities.

Just some thoughts,


-- 
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk 




More information about the Tutor mailing list