Title: Signature.html
I'm about to provide a config file for an application I've been working with. One can set a number of values via the GUI during the use of the program only to see the settings disappear when restarted. Fortunately, most of the time the program runs for days.  Nevertheless, there is a need to keep the values and settings. For example, latitude and longitude, offset in hours from Greenwich, mask file name, etc.

I'm quite sure I can write the code for this, even though somewhat inexperience in Python, using a tried and true method in most programming languages. That is, using a text file around to save all the values and then read from the file to restore them. A file something like this:

mask file: c:\operation/horizon.jpg
latitutde: -140.22
longitude 38.22
start time: 18:25:00
stop time: 06:30:00
event directory: d:\events_2009
grey scale: yes
autoexpose format: gif
...

Upon reading the file, one must set all the GUI values displayed to the user to the values in the config file. By the time I'm through adding new features, there may be 30 such values. Now there are about 15. It's possible I may want to add or subtract some as new work emerges.

I suspect there may be a standard way of doing this in Python that relies on more complex operations that simplify matters than just reading the file one line at a time. Dictionaries?  Comments?
--
           Wayne Watson (Watson Adventures, Prop., Nevada City, CA)

             (121.01 Deg. W, 39.26 Deg. N) GMT-8 hr std. time)
            
            Q: What do you do when your resistors get to hot?
            A: Open the switch and coulomb they off.
                 -- Anon. (fortunately!)

                    Web Page: <www.speckledwithstars.net/>
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to