[time-nuts] "PYLT" Python LabTools
phk at phk.freebsd.dk
Sun Jan 16 22:25:31 UTC 2011
In message <20110116221429.AF8D580003B at ip-64-139-1-69.sjc.megapath.net>, Hal Mu
>How about a config file?
Yeah, that bit is obvious, the trouble is all the "something like" :-)
I'm a firm beliver in Gettys principles for software development,
number 3 of which says:
3.The only thing worse than generalizing from one example
is generalizing from no examples at all.
But rather than write a lot of code to deal with config file reading,
we should simply use python:
Create a pylt_site.py containing something like:
return hp34401a.hp34401a(name="/dev/ttyfoo", adr=11)
return hp33120a.hp33120a(name="/dev/ttybar", adr=5)
and then use that in your programs:
# do stuff.
Problem solved ?
Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG | TCP/IP since RFC 956
FreeBSD committer | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
More information about the time-nuts