The Python standard is to use "site.py" to load custom startup code; this file is run automatically at startup. It's located in the Lib subdirectory of the directory containing the interpreter exe. 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"><<a href="mailto:toolsack@gmail.com">toolsack@gmail.com</a>></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'm hoping has an answer I'm looking for. I'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 -c "import start; from start import *;foo()"</p>
<p>what I'd like to be able to do is:</p>
<p>ipy.exe -c "foo()"</p>
<p>is that possible? (I have a .bat file that makes it work, but I'd like<br>to avoid if possible)</p>
<p>thanks</p>
<div>Richard</div><font color="#888888">
<div> </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>