Hi Dave, welcome to the list.

say you have Mod1.py and Mod2.py, and you want to call Mod1 in a
script inside Mod2. If you put both files in the same directory,
you'll just need to do in Mod2:

from Mod1 import *

and you'll be able to use the functions defined in Mod2. This is the
"current directory" scenario the documentation talks about, it's the
directory in which your main script will be executed.

If you want to make sure your modules are accessible system-wide, you
can put them in the special "site-packages" directory, which is
usually /PythonXX/Lib/site-packages (on a Mac, it might be under a
different tree, but it will still be called site-packages  I think).
If the file is there, you will be able to import its functions from
any script, with the same  "from Mod1 import * "

As a third option, you could mess around with the PYTHONPATH
environment variable, but i've no idea how you set it on a Mac.

cheers
Giacomo


On 11/1/07, Pangaea <[EMAIL PROTECTED]> wrote:
>
> Hi All
>
> I am quite new to Python and have only started to take an interest
> since its integration into Maya and RealFlow, as I am a VFX Artist
> working in Knutsford.
>
> My main question at present is where to put my .py module files so
> they can be loaded into other scripts. The documentation I have read
> just mentions the "current" directory. Though I am not sure where that
> is.
>
> Any help would be gratefully appreciated.
>
> D
>
>
> >
>


-- 
Giacomo Lacava

--~--~---------~--~----~------------~-------~--~----~
To post: [email protected]
To unsubscribe: [EMAIL PROTECTED]
Feeds available at http://groups.google.com/group/python-north-west/feeds
For more options: http://groups.google.com/group/python-north-west
-~----------~----~----~----~------~----~------~--~---

Reply via email to