<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Yes, about public scrutiny of code and your paragraphs on
"Everything.." and "However, not all..."-- both&nbsp; understood. <br>
<br>
Here's the print from the code line below.<br>
<img src="cid:part1.00010504.03050001@sbcglobal.net" alt=""><br>
Second line from the top.<br>
<br>
Regarding, ConfigObj, I was aware of it when I decided to go this
route. That's the one that uses has an init file like Windows?&nbsp; Rather
than have to go through a learning process on it (the Win init
module/object), and some uncertainty about it's acceptability in my
situation, I thought I'd be more exploratory and proceed as I have. So
far it has paid off in many learning dividends. ConfigObj, if not the
Win stuff, may be attractive. Anyway, I'd like to proceed for the
moment with this effort. <br>
<br>
Marc Tompkins wrote:
<blockquote
 cite="mid:40af687b0902171011k42a779eayc51ebf0f0396eab1@mail.gmail.com"
 type="cite">
  <div class="gmail_quote">On Tue, Feb 17, 2009 at 4:44 AM, Wayne
Watson <span dir="ltr">&lt;<a moz-do-not-send="true"
 href="mailto:sierra_mtnview@sbcglobal.net">sierra_mtnview@sbcglobal.net</a>&gt;</span>
wrote:<br>
  <blockquote class="gmail_quote"
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Note
that the diagnostic output in the image shows attributeError: 'str'
object has no attribute 'strftime'.<br>
    <br>
Let me see if I clarify what's really going on by including some of the
code.<br>
  </blockquote>
  <div><br>
Everything in Python - both variables and code - is an object.&nbsp; Objects
have attributes - data, basically - and methods - functions -
associated with them.&nbsp; (As Wesley pointed out, since pieces of code are
also objects, methods are attributes too.)<br>
  <br>
However, not all objects have the same attributes or methods associated
with them!&nbsp; datetime.time objects have a "strftime" method, which, when
called, returns a string representation of the time.&nbsp; String objects do
not have any such method or data attribute, hence the error.<br>
  <br>
You're showing us both too much code and too little - <br>
&nbsp; &nbsp; &nbsp; print "wtw self.stop_time", self.stop_time, type(self.stop_time)<br>
&nbsp; &nbsp; &nbsp; # set in GUI as datetime.time(6,0,0)<br>
&nbsp; &nbsp; &nbsp; # HEY wtw self.stop_time.strftime("%H:%M:%S")<br>
&nbsp; &nbsp; &nbsp; set_loc_dict[ "stop_time" ] = self.stop_time.strftime("%H:%M:%S")
&nbsp; &lt;&lt;----problem, see image in first post<br>
  <br>
I'd like to see the output of that "print" - I'm pretty sure that
"type" will return "str", not "time".&nbsp; <br>
  <br>
  </div>
  </div>
On another front, have you considered ConfigObj (<a
 moz-do-not-send="true"
 href="http://www.voidspace.org.uk/python/modules.shtml#configobj">http://www.voidspace.org.uk/python/modules.shtml#configobj</a>)?&nbsp;
When I first came to Python, I wrote myself a config-file handler
(serializing to XML, actually) and it worked OK - but everything was so
much work!&nbsp; I discovered ConfigObj and life is good.&nbsp; Here's a quick
example from one of my early programs I refactored to use ConfigObj
(NOT as a shining example of code, but just to show the power):<br>
  <br>
  <blockquote
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"
 class="gmail_quote">from configobj import ConfigObj<br>
from validate import Validator</blockquote>
  <div>... <br>
  </div>
  <blockquote
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"
 class="gmail_quote">&nbsp;&nbsp;&nbsp; cfgFileName = os.getcwd() + os.sep +
'fsr_1500.ini'<br>
&nbsp;&nbsp;&nbsp; tmpStr = """<br>
&nbsp;&nbsp;&nbsp; npiXMLFile = string(default="npiMap.XML")<br>
&nbsp;&nbsp;&nbsp; UCFformLength = integer(min=50, max=80, default=66)<br>
&nbsp;&nbsp;&nbsp; FIformLength = integer(min=50, max=80, default=64) <br>
&nbsp;&nbsp;&nbsp; OutformLength = integer(min=50, max=80, default=64) <br>
&nbsp;&nbsp;&nbsp; IncludeLegacy = boolean(default=False)<br>
&nbsp;&nbsp;&nbsp; TopLeft = int_list(min=2, max=2)<br>
&nbsp;&nbsp;&nbsp; BottomRight = int_list(min=2, max=2)<br>
&nbsp;&nbsp;&nbsp; FIHist = string_list(default=None)<br>
&nbsp;&nbsp;&nbsp; UCFHist = string_list(default=None)<br>
&nbsp;&nbsp;&nbsp; OutHist = string_list(default=None)<br>
&nbsp;&nbsp;&nbsp; LastRunUCF = boolean(default=True)<br>
&nbsp;&nbsp;&nbsp; LastRunPrinter = boolean(default=False)<br>
&nbsp;&nbsp;&nbsp; detailLeft = integer(min=0, max=80, default=0)<br>
&nbsp;&nbsp;&nbsp; detailTo = integer(min=0, max=80, default=9) <br>
&nbsp;&nbsp;&nbsp; detailPOS = integer(min=0, max=80, default=19)<br>
&nbsp;&nbsp;&nbsp; detailCode = integer(min=0, max=80, default=25)<br>
&nbsp;&nbsp;&nbsp; detailMods = integer(min=0, max=80, default=32)<br>
&nbsp;&nbsp;&nbsp; detailDiags = integer(min=0, max=80, default=44)<br>
&nbsp;&nbsp;&nbsp; detailCharge = integer(min=0, max=80, default=49)<br>
&nbsp;&nbsp;&nbsp; detailUnits = integer(min=0, max=80, default=58)<br>
&nbsp;&nbsp;&nbsp; detailEPSDT = integer(min=0, max=80, default=62)<br>
&nbsp;&nbsp;&nbsp; detailEMG = integer(min=0, max=80, default=22) <br>
&nbsp;&nbsp;&nbsp; detailID = integer(min=0, max=80, default=67)<br>
&nbsp;&nbsp;&nbsp; bodyLeftBlock = integer(min=0, max=80, default=0)<br>
&nbsp;&nbsp;&nbsp; bodyMidBlock = integer(min=0, max=80, default=24)<br>
&nbsp;&nbsp;&nbsp; bodyRightBlock = integer(min=0, max=80, default=49)<br>
&nbsp;&nbsp;&nbsp; bodyLabelEdge = integer(min=0, max=80, default=40)<br>
&nbsp;&nbsp;&nbsp; ConfirmSuccess = boolean(default=True)<br>
&nbsp;&nbsp;&nbsp; """<br>
&nbsp;&nbsp;&nbsp; cfgSpec = StringIO.StringIO(tmpStr)<br>
&nbsp;&nbsp;&nbsp; cfgFile = ConfigObj(cfgFileName, <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; configspec=cfgSpec, raise_errors=True,
write_empty_values=True, <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; create_empty=True, indent_type='&nbsp;&nbsp;&nbsp; ', list_values=True)<br>
&nbsp;&nbsp;&nbsp; vtor = Validator()</blockquote>
  <div>...<br>
  <blockquote
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"
 class="gmail_quote">&nbsp;&nbsp;&nbsp; cfgFile['TopLeft'] = data.GetMarginTopLeft()&nbsp;
# writing a couple of values<br>
&nbsp;&nbsp;&nbsp; cfgFile['BottomRight'] = data.GetMarginBottomRight()<br>
  </blockquote>
&nbsp;...<br>
  </div>
  <blockquote
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"
 class="gmail_quote">&nbsp;&nbsp;&nbsp; test = cfgFile.validate(Global.vtor, copy=True)<br>
&nbsp;&nbsp;&nbsp; cfgFile.write()<br>
  </blockquote>
  <br>
Looking at that, I see a few things I want to clean up.&nbsp; That's the
danger (and advantage) of exposing your own code to public scrutiny...<br>
  <br>
-- <br>
  <a moz-do-not-send="true" href="http://www.fsrtechnologies.com">www.fsrtechnologies.com</a><br>
  <pre wrap=""><hr size="4" width="90%">
_______________________________________________
Tutor maillist  -  <a class="moz-txt-link-abbreviated"
 href="mailto:Tutor@python.org">Tutor@python.org</a>
<a class="moz-txt-link-freetext"
 href="http://mail.python.org/mailman/listinfo/tutor">http://mail.python.org/mailman/listinfo/tutor</a>
  </pre>
</blockquote>
<br>
<div class="moz-signature">-- <br>
<meta content="text/html;" http-equiv="Content-Type">
<title>Signature.html</title>
<pre class="moz-signature" cols="76">           Wayne Watson (Watson Adventures, Prop., Nevada City, CA)

             (121.01 Deg. W, 39.26 Deg. N) GMT-8 hr std. time)
<font color="#330099">            </font>
<span style="font-weight: bold;"></span><b><b
 style="color: rgb(204, 51, 204);" class="b"><span
 style="color: rgb(255, 153, 255);"></span><span
 style="font-family: monospace;"></span></b></b>
                "Nature, to be commanded, must be obeyed."
                                   -- Sir Francis Bacon 
</pre>
<div style="margin-left: 40px;">
<b><b style="color: rgb(204, 51, 204);" class="b"><span
 style="font-family: monospace;"></span></b></b></div>
<pre class="moz-signature" cols="76"><b><b
 style="color: rgb(204, 51, 204);" class="b"><span
 style="font-family: monospace; color: rgb(153, 51, 153);"></span></b></b><b
 style="color: rgb(204, 51, 204);" class="b"><span
 style="font-family: monospace; color: rgb(153, 51, 153);"></span></b><span
 style="color: rgb(153, 51, 153);"></span><span
 style="color: rgb(153, 51, 153);">
</span><span style="color: rgb(153, 51, 153);"></span><b
 style="color: rgb(204, 51, 204);" class="b"><span
 style="font-family: monospace;"></span></b><span
 style="color: rgb(204, 51, 204);"></span>                    Web Page: &lt;<a
 class="moz-txt-link-abbreviated"
 href="http://www.speckledwithstars.net/">www.speckledwithstars.net/</a>&gt;</pre>
</div>
</body>
</html>