<div class="gmail_quote">On Mon, Jun 20, 2011 at 11:19 PM, Florencio Cano <span dir="ltr"><<a href="mailto:florencio.cano@gmail.com">florencio.cano@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div class="im">> import config_script obviously doesn't work and __import__(config_script)<br>
> works from the python interpreter but fails in the script (ImportError:<br>
> Import by filename is not supported.)<br>
<br>
</div>You can use this:<br>
<br>
exec("import " + module_name)<br>
<div><div></div><br></div></blockquote></div><br>Thanks for the hint. I will give that a try.<br><br><div class="gmail_quote">On Tue, Jun 21, 2011 at 2:48 AM, Terry Reedy <span dir="ltr"><<a href="mailto:tjreedy@udel.edu">tjreedy@udel.edu</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im"><br></div>
The main problem of your second method is that you repeat the check 
function in each script. That will be a problem if you ever want to 
modify it. I might put is into a separate file and import into each 
script.<div class="im"><br></div></blockquote><div><br>repeating the check function in each script is what I think I want. The 
check function is what would scan the system and make sure that 
compliance is met. I'm slightly confused about how that would become an 
issue later and what you mean about importing each of them ????<br> 
<br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">
<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
import config_script obviously doesn't work and<br>
__import__(config_script) works from the python interpreter but fails in<br>
the script (ImportError: Import by filename is not supported.)<br>
</blockquote>
<br></div>
Look at builtin function __import__(filename).<br><font color="#888888">Terry Jan Reedy</font></blockquote><div><br>I looked into __import__(filename) but that was not working for me, based upon the error in my previous message. I will give Florencio Cano's solution of using exec a try.  If there are any other ideas out there I'm all ears :)<br>

<br>Thanks everybody for the replies and guidance. <br></div><br></div><br>