<html>
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered)">
<title>[IronPython] Saving sys.path</title>
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
p
        {margin-right:0in;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.EmailStyle18
        {font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>There are, as far as I can see, three different ways to help in this
case and I am looking into implementing all of them very soon, definitely for
the next release.</span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> </span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>CPython uses environment variables PYTHONSTARTUP and PYTHONPATH to
drive the initialization of the interpreter</span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Also, on initialization, the interpreter executes statement “import
site” which is the third way to hook into the initialization process.</span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> </span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>As for the environment variables go, there is a question of naming. One
possibility is to use the well-known names (PYTHONSTARTUP, PYTHONPATH) and
another is to use our own: IRONPYTHONSTARTUP and IRONPYTHONPATH. We prefer the
latter (names prefixed with IRON) to avoid conflicts for those of us who use
CPython and IronPython on the same machine.</span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> </span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Unless there is strong reason to use the standard names, we will go
forward with the IRONPYTHON… ones.</span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> </span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>If you feel one way or another, please let us know. For the purpose of
the environment variable naming, we are not considering other naming schemes so
the choice is either standard names, or IRONPYTHON* ones.</span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> </span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Keith, I think this should provide you with the tools you need for your
work, correct? We will try to get this update out even sooner than usual. </span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> </span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Martin</span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> </span></font></p>
<div>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>
<hr size=2 width="100%" align=center tabindex=-1>
</span></font></div>
<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
users-ironpython.com-bounces@lists.ironpython.com
[mailto:users-ironpython.com-bounces@lists.ironpython.com] <b><span
style='font-weight:bold'>On Behalf Of </span></b>Keith J. Farmer<br>
<b><span style='font-weight:bold'>Sent:</span></b> Tuesday, April 26, 2005 4:02
PM<br>
<b><span style='font-weight:bold'>To:</span></b> Discussion of IronPython<br>
<b><span style='font-weight:bold'>Subject:</span></b> RE: [IronPython] Saving
sys.path</span></font></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> </span></font></p>
<div id=idOWAReplyText1925>
<div>
<p class=MsoNormal><font size=2 color=black face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:black'>Perhaps (to at least keep the .NET way) a
.config file instead of an environment variable?</span></font></p>
</div>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> </span></font></p>
</div>
<div>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>That file *could* specify one or more startup files, to
maintain the Python mystique.</span></font></p>
</div>
</div>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'> </span></font></p>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>
<hr size=2 width="100%" align=center tabIndex=-1>
</span></font></div>
<p class=MsoNormal style='margin-bottom:12.0pt'><b><font size=2 face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
users-ironpython.com-bounces@lists.ironpython.com on behalf of Michael Spencer<br>
<b><span style='font-weight:bold'>Sent:</span></b> Tue 4/26/2005 3:52 PM<br>
<b><span style='font-weight:bold'>To:</span></b>
users-ironpython.com@lists.ironpython.com<br>
<b><span style='font-weight:bold'>Subject:</span></b> [IronPython] Saving
sys.path</span></font></p>
</div>
<div>
<p><font size=2 face="Times New Roman"><span style='font-size:10.0pt'>Second
feature request of the week:<br>
<br>
I would like to save sys.path settings between interpreter sessions.<br>
<br>
Is there a way to do this today?<br>
<br>
If not, could there be an OS environment variable for this or, a startup.py
file<br>
loaded each time the interpreter starts?</span></font></p>
</div>
</div>
</body>
</html>