On Wed, Mar 21, 2012 at 8:25 AM, Rod Person <rodper...@rodperson.com> wrote:
<snip>
> The question is there a way I can do this with out having to import
> constants when what it's doing is importing itself. It would seem to me
> that there should be a way for a module to reference itself. In that
> thinking I have tried
>
>  if not(hasattr(__file__, value):
>  if not(hasattr(__name__, value):
>
> and even:
>
>  this = sys.argv[0]
>  if not(hasattr(this, value):
>
> None of which works.

http://stackoverflow.com/questions/2933470/how-do-i-call-setattr-on-the-current-module

Cheers,
Chris
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to