The Python standard is to use &quot;site.py&quot; to load custom startup code; this file is run automatically at startup.&nbsp; It&#39;s located in the Lib subdirectory of the directory containing the interpreter exe.&nbsp; This works under both CPython and IronPython.<br>
<br>
<div class="gmail_quote">On Thu, Nov 27, 2008 at 1:22 PM, Richard Bowen <span dir="ltr">&lt;<a href="mailto:toolsack@gmail.com">toolsack@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<p>Hi</p>
<p>I have a simple question that I&#39;m hoping has an answer I&#39;m looking for. I&#39;d<br>like to have a startup script to seamlessly run before running a<br>specified script.</p>
<p>Eg I can have a script/module that defines foo() and call on startup</p>
<p>IRONPYTHONSTARTUP=start.py</p>
<p>then when I run ipy I can call foo() straight on the command line.</p>
<p>However when running a command or script I have to re-import the module:</p>
<p>ipy.exe&nbsp; -c &quot;import start; from start import *;foo()&quot;</p>
<p>what I&#39;d like to be able to do is:</p>
<p>ipy.exe -c &quot;foo()&quot;</p>
<p>is that possible? (I have a .bat file that makes it work, but I&#39;d like<br>to avoid if possible)</p>
<p>thanks</p>
<div>Richard</div><font color="#888888">
<div>&nbsp;</div></font><br>_______________________________________________<br>Users mailing list<br><a href="mailto:Users@lists.ironpython.com">Users@lists.ironpython.com</a><br><a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
<br></blockquote></div><br>