Is there a way to print in Python that will not output the current contents of stdin?
<p>I'm using select to wait for stdin or data from the server/client, but if I receive a message while typing, my current text is printed as well the received message. I may be using select incorrectly, but I need to find a way to maintain what's currently being typed without it being output with the message.</p>

<p>I haven't tried it (so I might be a bit out of my expertise) but <a href="http://rpyc.readthedocs.io/en/latest/index.html" rel="nofollow">RPyC</a> might be able to do what you are asking. In its <a href="http://rpyc.readthedocs.io/en/latest/docs/howto.html" rel="nofollow">How To</a> page they show a couple of snippets that direction the print for both host and local:</p>

<pre><code>&gt;&gt;&gt; import rpyc
&gt;&gt;&gt; c = rpyc.classic.connect("localhost")
&gt;&gt;&gt; c.execute("print 'hi there'")   # this will print on the host
&gt;&gt;&gt; import sys
&gt;&gt;&gt; c.modules.sys.stdout = sys.stdout
&gt;&gt;&gt; c.execute("print 'hi here'")   # now this will be redirected here
hi here
</code></pre>

<p>, or:</p>

<pre><code>&gt;&gt;&gt; c.execute("print 'hi there'")                   # printed on the server
&gt;&gt;&gt;
&gt;&gt;&gt; with rpyc.classic.redirected_stdio(c):
...     c.execute("print 'hi here'")                # printed on the client
...
hi here
&gt;&gt;&gt; c.execute("print 'hi there again'")             # printed on the server
&gt;&gt;&gt; 
</code></pre>

python