Re: How to write a simple shell loop in python?

2009-01-23 Thread Dietrich Bollmann
[Sorry for top posting - I had a HD problem and lost the original mails] Hi Saul, Steve, Ben, James, Scott David and James! Thank you all very much for your help! I finally got rid of the extra space and also understood why the space was printed :) After using Steve's 'input = raw_input("$ ")' s

Re: How to write a simple shell loop in python?

2009-01-21 Thread Scott David Daniels
Dietrich Bollmann wrote: I am trying to write a simple shell loop in Python. My simple approach works fine - but the first output line after entering something is always indented by one blank. Is there any logic explanation for this? Yes How can I get rid of the blank? By not asking for i

Re: How to write a simple shell loop in python?

2009-01-21 Thread Steve Holden
Dietrich Bollmann wrote: > Hi, > > I am trying to write a simple shell loop in Python. > > My simple approach works fine - but the first output line after entering > something is always indented by one blank. > > Is there any logic explanation for this? > How can I get rid of the blank? > Is

Re: How to write a simple shell loop in python?

2009-01-20 Thread Ben Finney
Dietrich Bollmann writes: > I am trying to write a simple shell loop in Python. You should investigate the ‘cmd’ module in the standard library http://docs.python.org/library/cmd.html>. > My simple approach works fine - but the first output line after > entering something is always indented by

Re: How to write a simple shell loop in python?

2009-01-20 Thread James Mills
On Wed, Jan 21, 2009 at 3:12 PM, Saul Spatz wrote: > Strange. I don't have an explanation, but experiment shows that if you > change print "$ ", to print "$ " (that is, leave out the comma) then the > leading blank is not printed. This behavior doesn't depend on the "print > input" statement's b

Re: How to write a simple shell loop in python?

2009-01-20 Thread Saul Spatz
Dietrich Bollmann wrote: Hi, I am trying to write a simple shell loop in Python. My simple approach works fine - but the first output line after entering something is always indented by one blank. Is there any logic explanation for this? How can I get rid of the blank? Is there a smarter