<br><br><div class="gmail_quote">On Fri, Jan 20, 2012 at 2:42 PM, Emile van Sebille <span dir="ltr">&lt;<a href="mailto:emile@fenx.com">emile@fenx.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 1/20/2012 10:34 AM Tino Dai said...<div class="im"><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi everybody,<br>
<br>
      Got a namespace question framed inside a Django project (but I<br>
still think it&#39;s pertinent to Python). We moved and broke settings.py<br>
four different files in a separate directory called settings. So instead<br>
of doing a<br>
<br>
 &gt;&gt;&gt; import settings<br>
 &gt;&gt;&gt; settings.whatever<br>
<br>
We are having to do:<br>
<br>
 &gt;&gt;&gt; import settings<br>
 &gt;&gt;&gt; settings.settings.whatever<br>
</blockquote>
<br>
<br></div>
You could....<br>
<br>
from settings import settings<br>
<br>
... which then allows access as<br>
<br>
settings.whatever<br>
<br>
<br>
HTH,<br>
<br>
Emile<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
<br>
This is inconvenient and probably will break stuff especially with<br>
django framework code. Is there a way to play with the namespacing to<br>
have python have the former behavior rather than the latter behavior?<br>
<br>
Thanks,<br>
Tino<br>
<br>
<br>
<br></div><div class="im">
______________________________<u></u>_________________<br>
Tutor maillist  -  <a href="mailto:Tutor@python.org" target="_blank">Tutor@python.org</a><br>
To unsubscribe or change subscription options:<br>
<a href="http://mail.python.org/mailman/listinfo/tutor" target="_blank">http://mail.python.org/<u></u>mailman/listinfo/tutor</a><br>
</div></blockquote><div class="HOEnZb"><div class="h5">
<br>
<br>
______________________________<u></u>_________________<br>
Tutor maillist  -  <a href="mailto:Tutor@python.org" target="_blank">Tutor@python.org</a><br>
To unsubscribe or change subscription options:<br>
<a href="http://mail.python.org/mailman/listinfo/tutor" target="_blank">http://mail.python.org/<u></u>mailman/listinfo/tutor</a><br>
</div></div></blockquote></div><br>Yes I think you could also:<br><br>&gt;&gt;&gt; import settings as settings<br>or <br>&gt;&gt;&gt; import settings as s<br><br>( or whatever )<br><br clear="all"><br>-- <br>Alexander<br>
7D9C597B<br><br>