Phil,<div><br></div><div>there is one more way you can run all commands as in linux shell..</div><div><br></div>>>> import commands<br>>>> s, o = commands.getstatusoutput('x=10;for i in $(seq $x); do echo $i ; done')<br>
>>> print o<br>1<br>2<br>3<br>4<br>5<br>6<br>7<br>8<br>9<br>10<br>>>> <br><div><br><div class="gmail_quote">On Sun, Apr 17, 2011 at 11:40 AM, Phil Winder <span dir="ltr"><<a href="mailto:philipwinder@gmail.com" target="_blank">philipwinder@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div>On Apr 17, 1:11 pm, Andrea Crotti <<a href="mailto:andrea.crott...@gmail.com" target="_blank">andrea.crott...@gmail.com</a>> wrote:<br>
> Phil Winder <<a href="mailto:philipwin...@gmail.com" target="_blank">philipwin...@gmail.com</a>> writes:<br>
</div><div>> > Yes, that does not produce an error, but it does not "work". Please<br>
> > refer to my first post. Try the first code, you will get a syntax<br>
> > error. Placing things on one line makes for easy history scrollback.<br>
> > In your version you will have 2 lines of history for the x = 0 term<br>
> > and the while ... term. I don't want to have to press up twice,<br>
> > especially when the code was in the distant past! Also cpaste might be<br>
> > ok for scripting, but it looks too clumsy to use at the command line.<br>
><br>
> > Cheers,<br>
> > Phil<br>
><br>
</div><div>> Well I guess that's the way it is with the interpreter..<br>
> But I don't see the sense in doing everything from there, just write the<br>
> code to a file and use %edit from ipython to change and run it, it's<br>
> quite nice and easy too.<br>
<br>
</div>Ok, thanks all. It's a little disappointing, but I guess that you<br>
always have to work in a different way when you move to a new<br>
language. Andrea's %edit method is probably the best compromise, but<br>
this now means that I will have to learn all the (obscure) shortcuts<br>
for vi!<br>
<div><div></div><div><br>
Cheers,<br>
Phil<br>
--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</div></div></blockquote></div><br></div>