Everything you could want to know! http://docs.python.org/tutorial/modules.html#the-module-search-path
On Mon, Aug 8, 2011 at 1:50 PM, Renato Polimeno <[email protected]>wrote: > humm.. > In the a PYTHONPATH var do I need the path only ie. *server/customscripts; > * or each python file ie. *server/customscripts/file_01.py;** > server/customscripts/file_02.py* ? > Do I need to run sys.path.append('*server/customscripts*') every time > after a local machine opens Maya ? > > > On Sun, Aug 7, 2011 at 6:01 PM, Seth Gibson <[email protected]>wrote: > >> sys.path and PYTHONPATH are two different things. If you don't want too >> much (or any) per-user/machine deviance, you could try putting a root on >> PYTHONPATH and doing all your site specific setup using a combination of >> sitecustomize and userSetup, depending on how much segregation/detail you're >> looking for. >> >> >> On Sun, Aug 7, 2011 at 12:14 PM, ArrantSquid <[email protected]>wrote: >> >>> Exactly what Adam said: >>> >>> import sys >>> sys.path.append('/path/to/script/folder') >>> >>> Not the full path to the script, just the directory it resides in. >>> >>> On Aug 7, 12:13 pm, Adam Mechtley <[email protected]> wrote: >>> > Python scripts use PYTHONPATH, not MAYA_SCRIPT_PATH >>> > >>> > On Sun, Aug 7, 2011 at 2:06 PM, Renato Polimeno <[email protected] >>> >wrote: >>> > >>> > >>> > >>> > > Hey guys, I´m stuck in a problem.. >>> > >>> > > A common project directory inside a server is the main source folder >>> for me >>> > > and a bunch of artists... I´ve created a script folder plus a .env >>> with >>> > > custom variables: screenshot.jpg< >>> http://renatopolimeno.com/wp-content/uploads/questionENV_py_script_fi.. >>> .> >>> > >>> > > I was in hope that each Maya (local machines) would source and load >>> > > all custom python scripts automaticly but unfortunately it didn´t >>> work.. ie. >>> > >>> > > import customScript >>> > > "ImportError: No module named customScript.py " >>> > >>> > > What am I missing? >>> > > How would you guys go about it? >>> > > What are the mainly steps to complete that task? >>> > >>> > > Thanks in advance, >>> > >>> > > ____________________________ >>> > > -> Renato Polimeno >>> > > +55 11 7539 3615 >>> > > renatopolimeno.com <http://www.renatopolimeno.com> >>> > > <http://www.renatopolimeno.com/>facebook.com/renato.polimeno< >>> http://www.facebook.com/renato.polimeno> >>> > > @renatopolimeno <http://www.twitter.com/renatopolimeno> >>> > >>> > > -- >>> > > view archives:http://groups.google.com/group/python_inside_maya >>> > > change your subscription settings: >>> > >http://groups.google.com/group/python_inside_maya/subscribe- Hide >>> quoted text - >>> > >>> > - Show quoted text - >>> >>> -- >>> view archives: http://groups.google.com/group/python_inside_maya >>> change your subscription settings: >>> http://groups.google.com/group/python_inside_maya/subscribe >>> >> >> -- >> view archives: http://groups.google.com/group/python_inside_maya >> change your subscription settings: >> http://groups.google.com/group/python_inside_maya/subscribe >> > > > > -- > ______________________________ > > -> Renato Polimeno > +55 11 7539 3615 > renatopolimeno.com <http://www.renatopolimeno.com> > > <http://www.renatopolimeno.com/>facebook.com/renato.polimeno<http://www.facebook.com/renato.polimeno> > @renatopolimeno <http://www.twitter.com/renatopolimeno> > > > -- > view archives: http://groups.google.com/group/python_inside_maya > change your subscription settings: > http://groups.google.com/group/python_inside_maya/subscribe > -- view archives: http://groups.google.com/group/python_inside_maya change your subscription settings: http://groups.google.com/group/python_inside_maya/subscribe
