<br><br><div class="gmail_quote">On Mon, May 11, 2009 at 2:38 PM, Gökhan SEVER <span dir="ltr"><<a href="mailto:gokhansever@gmail.com">gokhansever@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I meant in ipython.<br><br>It does run actually if an alias be defined for the script. However, in this case I can't get variables and /or results in to the ipython's namespace.</blockquote><div><br></div><div>The only way I'm aware of to run this in iPython is to use the run command. This is just a script in the current directory. A minimal example is:</div>
<div><br></div><div># ------------------------------------</div><div>import sys</div><div><br></div><div>if __name__ == "__main__":</div><div><br></div><div> f = sys.argv[1:]</div><div> print f</div><div># ------------------------------------</div>
<div><br></div><div>If you pass multiple files to this as you would in bash f has the value ['test*.dat'].</div><div><br></div><div>Jeremy</div><div><br></div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br><font color="#888888"><br clear="all">Gökhan</font><div><div></div><div class="h5"><br>
<br><br><div class="gmail_quote">On Mon, May 11, 2009 at 1:35 PM, Jeremy Conlin <span dir="ltr"><<a href="mailto:jeremit0@gmail.com" target="_blank">jeremit0@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">
<br><br><div class="gmail_quote"><div>On Mon, May 11, 2009 at 2:24 PM, Gökhan SEVER <span dir="ltr"><<a href="mailto:gokhansever@gmail.com" target="_blank">gokhansever@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">
Hi,<br><br>This might be might a solution for your case:<br><br>In [1]: files = !ls test*<br><br>In [2]: for i in files:<br> ....: run myScripy.py $i<br><br>However, there could be a simpler solution that I don't know of as well.<br>
<br>Do you have any idea how to run your script without issuing a "run" command in front of it?<br></blockquote><div><br></div></div><div>I can run my command just fine in bash without any problems by replacing "run" with python.</div>
<div><br></div><font color="#888888"><div>Jeremy </div></font></div>
</blockquote></div><br>
</div></div></blockquote></div><br>