<div>&nbsp;</div>
<div>Is it possible to make the utility like in vi, where the user keeps on entering the data and when he hits ':wq', the work is saved and the application exists.</div>
<div>&nbsp;</div>
<div>I guess the use of standard input file would be applicable???</div>
<div>&nbsp;</div>
<div>Thanks.</div>
<div>Regrds,</div>
<div>Asrar<br>&nbsp;</div>
<div><span class="gmail_quote">On 10/14/06, <b class="gmail_sendername">Alan Gauld</b> &lt;<a href="mailto:alan.gauld@btinternet.com">alan.gauld@btinternet.com</a>&gt; wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">&gt; I am trying to build a simple text editor which has a couple of<br>&gt; options of<br>&gt; editing, displaying and saving the file.
<br><br>Are you using a GUI or console?<br>The solution is potentially quite different depending on the choice.<br><br>&gt; Now what I want to do is to allow teh user to keep entering the text<br>&gt; unless<br>&gt; he pressed ':q'.
<br><br>How are you reading the characters in the first place?<br><br>if you can find a way to read characters from the keyboard<br>one at a time then<br><br>while True<br>&nbsp;&nbsp;&nbsp;&nbsp;ch = getchar()<br>&nbsp;&nbsp;&nbsp;&nbsp;if ch ==':'<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ch = getchar()
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ch == 'q': break<br><br>Will work.<br><br>So the question becomers do you know how to write getchar()?<br><br>Alan G.<br><br><br>_______________________________________________<br>Tutor maillist&nbsp;&nbsp;-&nbsp;&nbsp;<a href="mailto:Tutor@python.org">
Tutor@python.org</a><br><a href="http://mail.python.org/mailman/listinfo/tutor">http://mail.python.org/mailman/listinfo/tutor</a><br></blockquote></div><br><br clear="all"><br>-- <br>To HIM you shall return.