Login  Register

Python/Jython code that doesn't work in ImageJ

Posted by J. Daniel Fenn on Jul 07, 2014; 9:01pm
URL: http://imagej.273.s1.nabble.com/Python-Jython-code-that-doesn-t-work-in-ImageJ-tp5008609.html

The following code works fine on my desktop version of python (2.7) but
it does not work using the ImageJ/Fiji code editor (which I believe is
using python 2.5.2)


dirRawIn = os.path.join(dirBase, dirRaw)
dirAnlOut = os.path.join(dirBase, dirAnl)
dirMntOut = os.path.join(dirBase, dirMnt)

def mkdir_p(path):
    print path
    try:
        os.makedirs(path)
    except OSError, exc:
        if exc.errno == errno.EEXIST and os.path.isdir(path):
            pass
        else:
            raise

mkdir_p(dirAnlOut)
mkdir_p(dirMntOut)


I'm pretty sure everything I've read suggests that code should work even
on python 2.5.  Does anyone have any ideas why this code doesn't work
within Fiji?

I just get a huge block of Traceback error text that doesn't give me any
real information.  I can post if it is needed.

Thanks

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html