[Tutor] tcl/tkinter on python 2.1 for mac os x
alan.gauld@bt.com
alan.gauld@bt.com
Fri, 11 Jan 2002 11:33:41 -0000
> I am learning python from Gauld's book and Laningham's book.
Excellent choice both ;-)
> the download has a note where the tkinter modules should be
> saying they are not available yet.
I'm not sure what you mean by this bit and will rely
on some Mac users helping out - Macs are a mystery to me...
> PS: There is kind of a gap between what's covered in
> the above cited books and the regular list of books.
My book is intended to get you up to the point where the
other books and online resources make sense!
> simplified spreadsheet (dumber than dan bricklin visicalc)
First try a text based 4 function calculator.
Define a language to enter sums:
A session might look like:
>>> import calculator
>>> calculator.calculate()
Calc: + 4 4
Res = 8
Calc: * 2 9
Res = 18
Calc: Q
Quitting calculator
>>>
(A Spreadsheet at the dumb level is just a two
dimensional array of such calculators! with some
variable storage and cross referencing capabilities)
> and flatfile database so that old farts like me who
> are learning to code as a cultural endeavor rather
> a productive one can get an idea of how these
> types of apps are made.
Starting from first principles get an object to
read/write its attributes to a file.
Now get a list of such objets to do the same.
Now figure out how to search for/insert/delete entries
from the list
You've now got a very inefficient database system :-)
Now learn to use the python shelve module to do the
same job - you now have a more efficient database
Now move onto the db modules for real power.
> objects but I don't really get how to do the methods
> for a record object.
Initially just write each attribute into a single line
using a format string. For more complex things(like
embedded lists you can use a formatting language
(XML seeems a good place to start...)
> that could also show the easier to implement ideas of
> relational dbs as well
Implementing relational capability from scratch is harder
and IMHO not worth the pain. Once you understand how to
store simple objects and objects with internal lists
of values jump straight to a proper database like mySQL
and the db modules.
HTH,
Any other questions feel free to ask thats what we're here for.
Alan g.
Author of the 'Learning to Program' web site
http://www.freenetpages.co.uk/hp/alan.gauld