Set PYTHONPATH

Simon Forster simon-lists at ldml.com
Wed Apr 21 00:46:20 PDT 2004


Complete neophyte question(s) here but...

I've written a very simple Python module which I want to call via 
AppleScript from within FileMaker Pro.

Problem: I need to load my module so that I can call the Python 
function with the appropriate arguments. To put this in some form of 
context. From the command line:

python
 >>> sys.path.append('/Users/simonforster/Development/Python/Lib')
 >>> import regex_domain3
 >>> regex_domain3.GetDomain('www.look4generics.com/storvas .htm')
'www.look4generics.com'

Now, in theory I can write an AppleScript which'll mimic this approach. 
i.e. Set the python path, import the module, do the do. But this seems 
incredibly wasteful. (Bear in mind that the AppleScript call is 
stateless. i.e. each time I run it it'll be analogous to starting a 
completely new shell).

So, how do I set python's path for my user? And, FWIW, if I "echo 
$PYTHONPATH" in the Terminal, I get a blank line. My research suggests 
that this is a valid environment variable though. Don't understand.

Can anyone help me here?

TIA

Simon Forster
_____________________________________________________
  LDML Ltd, 62 Pall Mall, London, SW1Y 5HZ, UK
  Tel: +44 (0)70 9230 5244   Fax: +44 (0)70 9230 5247
_____________________________________________________



More information about the X-Unix mailing list