<!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">
I took your "starter" code, and formatted it to be what I hope is an
acceptable program, Gobal_Config.py. See attached. I'm using Python
2.5.2. I put the two modules in the same folder with it, and executed
it in IDLE. I got this:<br>
...<br>
File
"C:\Sandia_Meteors\New_Sentinel_Development\Sentuser_Utilities_Related\sentuser\configobj.py",
line 1637, in _parse<br>
ParseError, infile, cur_index)<br>
File
"C:\Sandia_Meteors\New_Sentinel_Development\Sentuser_Utilities_Related\sentuser\configobj.py",
line 1748, in _handle_error<br>
raise error<br>
ParseError: Invalid line at line "1".<br>
<br>
As far as I can tell, line 1 of config.obj looks OK. It's a comment.
Something is amiss.<br>
<br>
Does PYTHONPATH apply in Win XP? I haven't played at the level of paths
for a long time in any OS. We can worry about an install "package"
later for the modules. It might be best for the users of this program. <br>
<br>
When I was using Python 2.4, I could find an entry on Start for it, and
get an item on it under Python 2.4 called something like Library Paths.
I don't see that at all on Python 2.5. Bad memory, I just checked on my
laptop, which has 2.4; however, I recall being able to probe Python
library paths. This may be irrelevant.<br>
<br>
The ConfigObj 4 Introduction and Ref doc doesn't seem to associate it
with any version of Python. Its version is 4.5.3. Puzzled ...<br>
<br>
Marc Tompkins wrote:
<blockquote
cite="mid:40af687b0902181314n1810ef86j43b76509ca90bee@mail.gmail.com"
type="cite">
<div class="gmail_quote">On Wed, Feb 18, 2009 at 1:01 PM, Wayne
Watson <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:sierra_mtnview@sbcglobal.net">sierra_mtnview@sbcglobal.net</a>></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;">
<div bgcolor="#ffffff" text="#000000">OK, I got the ObjectConfig
and Validate downloads, and copied your
Global class successfully. Don't I need to get the two files into
Python as a module? How does that work?<br>
</div>
</blockquote>
<div><br>
Simplest: put them in the same folder as your own program. More
standard: put them in one of the folders in your Python path - same
general idea as the DOS search path, it's a list of directories where
Python will look for modules you ask it to import.<br>
<br>
>From the docs: (<a moz-do-not-send="true"
href="http://docs.python.org/tutorial/modules.html">http://docs.python.org/tutorial/modules.html</a>)<br>
<h3>The Module Search Path<a moz-do-not-send="true" class="headerlink"
href="http://docs.python.org/tutorial/modules.html#the-module-search-path"
title="Permalink to this headline">¶</a></h3>
<p id="index-1051">When a module named <tt
class="xref docutils literal"><span class="pre">spam</span></tt> is
imported, the interpreter searches for a file
named <tt class="docutils literal"><span class="pre">spam.py</span></tt>
in the current directory, and then in the list of
directories specified by the environment variable <span class="target"
id="index-1052"></span><a moz-do-not-send="true"
class="reference external"
href="http://docs.python.org/using/cmdline.html#envvar-PYTHONPATH"><strong
class="xref">PYTHONPATH</strong></a>. This
has the same syntax as the shell variable <span class="target"
id="index-1053"></span><strong class="xref">PATH</strong>, that is, a
list of
directory names. When <span class="target" id="index-1054"></span><a
moz-do-not-send="true" class="reference external"
href="http://docs.python.org/using/cmdline.html#envvar-PYTHONPATH"><strong
class="xref">PYTHONPATH</strong></a> is not set, or when the file is
not
found there, the search continues in an installation-dependent default
path; on
Unix, this is usually <tt class="docutils literal"><span class="pre">.:/usr/local/lib/python</span></tt>.</p>
<p>Actually, modules are searched in the list of directories given by
the variable
<tt class="docutils literal"><span class="pre">sys.path</span></tt>
which is initialized from the directory containing the input script
(or the current directory), <span class="target" id="index-1055"></span><a
moz-do-not-send="true" class="reference external"
href="http://docs.python.org/using/cmdline.html#envvar-PYTHONPATH"><strong
class="xref">PYTHONPATH</strong></a> and the installation- dependent
default. This allows Python programs that know what they're doing to
modify or
replace the module search path. Note that because the directory
containing the
script being run is on the search path, it is important that the script
not have
the same name as a standard module, or Python will attempt to load the
script as
a module when that module is imported. This will generally be an error.
See
section <a moz-do-not-send="true" class="reference internal"
href="http://docs.python.org/tutorial/modules.html#tut-standardmodules"><em>Standard
Modules</em></a> for more information.</p>
<br>
</div>
<blockquote class="gmail_quote"
style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div bgcolor="#ffffff" text="#000000">
<blockquote type="cite">
<div>
<div class="Wj3C7c"><br>
<a moz-do-not-send="true" href="http://www.fsrtechnologies.com"
target="_blank">www.fsrtechnologies.com</a><br>
</div>
</div>
<pre><pre><hr size="4" width="90%">
_______________________________________________
Tutor maillist - <a moz-do-not-send="true"
href="mailto:Tutor@python.org" target="_blank">Tutor@python.org</a>
<a moz-do-not-send="true"
href="http://mail.python.org/mailman/listinfo/tutor" target="_blank">http://mail.python.org/mailman/listinfo/tutor</a>
</pre></pre>
</blockquote>
<div class="Ih2E3d"><br>
<div>-- <br>
<pre 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);"><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);"><span
style="font-family: monospace;"></span></b></b></div>
<pre cols="76"><b><b style="color: rgb(204, 51, 204);"><span
style="font-family: monospace; color: rgb(153, 51, 153);"></span></b></b><b
style="color: rgb(204, 51, 204);"><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);"><span style="font-family: monospace;"></span></b><span
style="color: rgb(204, 51, 204);"></span> Web Page: <<a
moz-do-not-send="true" href="http://www.speckledwithstars.net/"
target="_blank">www.speckledwithstars.net/</a>></pre>
</div>
</div>
</div>
</blockquote>
</div>
<br>
<br clear="all">
<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: <<a class="moz-txt-link-abbreviated" href="http://www.speckledwithstars.net/">www.speckledwithstars.net/</a>></pre>
</div>
</body>
</html>