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($ )'

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 there a

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

How to write a simple shell loop in python?

2009-01-20 Thread Dietrich Bollmann
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 way to write a simple shell

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

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 ssp...@kcnet.com 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

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

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