.pth files and figuring out valid paths..

rh0dium steven.klass at gmail.com
Wed Jun 10 00:30:09 EDT 2009

On Jun 9, 9:19 pm, alex23 <wuwe... at gmail.com> wrote:
> On Jun 10, 8:00 am, rh0dium <steven.kl... at gmail.com> wrote:
> > Apparently there is a problem with the if statement???
> Try restructuring the if as a ternary condition:
> import os, site; smsc = os.environ.get("TECHROOT", "/home/tech"); smsc
> = smsc if os.path.isdir(smsc) else "/home/tech"; site.addsitedir
> (os.path.join(smsc, "tools/python/Linux/%arch/lib/python2.5/site-
> packages"))

Bingo - Nice Job!!  Thanks!  I had to look up ternary conditions!!
That's new for me (http://en.wikipedia.org/wiki/Ternary_operation)

More information about the Python-list mailing list