[Bf-committers] Scripts directory

bf-committers@blender.org bf-committers@blender.org
Sun, 26 Oct 2003 07:54:15 -0500


This is a multi-part message in MIME format.

------=_NextPart_000_0021_01C39B96.59FD0660
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

This might be a silly question but when someone writes a multi-part .py =
file and then tries to 'import' one of the other .py files (to use it's =
functions/classes) it seems that only the python path is searched for =
the .py files.  If you put the .py scripts in the /.blender bin for the =
executable they are hidden from python. =20
I read an old post that says that a module has to be in the global =
dictionary in sys.modules.  Do you have to import the .py file as a =
sys.module? What about setting the sys.path to include the /.blender =
bin. The path would be cool if you knew that it would work on Unix and =
windows. What about forcing the sys.module to pick up your .py file and =
then del the key when done.
Wasn't guignot working on making a scripts directory? It would seem =
silly to have to run all of your scripts from the python22 directory if =
they are multi part. I think im missing something here ?'-'? I need =
enlightenment. ~:-:~

I know what about calling BLI_gethome() to return the /.blender bin path =
and adding it to the python path. That .py files in the bin will be auto =
added to the sys.modules right?
------=_NextPart_000_0021_01C39B96.59FD0660
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1106" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#d8d0c8>
<DIV><FONT face=3DArial size=3D2>This might be a silly question but when =
someone=20
writes a multi-part .py file and then tries to 'import' one of the other =
.py=20
files (to use it's functions/classes)&nbsp;it seems that only the python =
path is=20
searched for the .py files.&nbsp; If you put the .py&nbsp;scripts in=20
the&nbsp;/.blender bin&nbsp;for the executable they are hidden=20
from&nbsp;python.&nbsp;&nbsp;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I read an old post&nbsp;that&nbsp;says =
that&nbsp;a=20
module has to be in the global dictionary in sys.modules.&nbsp; Do you =
have to=20
import the .py file as a sys.module? What about setting the sys.path to =
include=20
the /.blender bin.&nbsp;The path would be cool if you knew that it would =
work on=20
Unix and windows. What about forcing the sys.module to pick up your .py =
file and=20
then del the key when done.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Wasn't&nbsp;guignot working on making a =
scripts=20
directory? It would seem silly to have to run all of your scripts from =
the=20
python22 directory if they are multi part. I think im missing something =
here=20
?'-'? I need enlightenment. ~:-:~</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I know what about calling BLI_gethome() =
to return=20
the /.blender bin path and adding it to the python path. That .py files =
in the=20
bin will be auto added to the sys.modules =
right?</FONT></DIV></BODY></HTML>

------=_NextPart_000_0021_01C39B96.59FD0660--