In message <[email protected]>, Hal Mu
rray writes:

>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:

        import hp34401a
        import hp33120a

        def hp34401a():
                return hp34401a.hp34401a(name="/dev/ttyfoo", adr=11)

        def hp33120a():
                return hp33120a.hp33120a(name="/dev/ttybar", adr=5)

and then use that in your programs:

        include pylt_site

        g=pylt_site.hp33120a()
        m=pylt_site.hp34401a()

        # do stuff.

Problem solved ?

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
[email protected]         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.

_______________________________________________
time-nuts mailing list -- [email protected]
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.

Reply via email to