Re: [jokosher-devel] Planning 0.2



On Mon, Jul 17, 2006 at 08:19:05AM +0100, Stuart Langridge wrote:
> 
> On the other hand, it makes it a little more fiddly to grab the code
> and run it *without* installation, I suspect, andone of my goals is
> that Jokosher should be relocatable. I suppose the "jokosher"
> executable, which would actually be a script, can just "import
> jokosher" which would pick it up from . if it's there and
> site-packages (which is already on sys.path) if it isn't.
> 

The following script will run jokosher from the current directory (if it's
there) and then will try from site-packages if jokosher is installed there.
The executable could be on the path or you could just be running
./jokosher after downloading and extracting a tarball without installing.

#!/usr/bin/python

import sys
sys.path.insert(0,".")
try:
  import Jokosher
except:
  try:
    from jokosher import Jokosher
  except:
    print "jokosher not found on python path"
    sys.exit(1)
Jokosher.main()


-- 
John Green



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]