title: How to redirect output to client
body: <p>I'm a relatively new programmer in Python, and I have created this XMLRPC Server function as follows:</p>
  
  <pre><code>def shell(self, command, username):
      if username in loggedIn:
          return os.system(command)
      else:
          string = time.asctime() , " not logged in"
          string = "".join(string)
          return string
  </code></pre>
  
  <p>For the client side, I have written</p>
  
  <pre><code>command = raw_input ("$ ")
  if command == "exit":
      exit()
  else:
      server.shell(command, username)
  </code></pre>
  
  <p>However, when I run the command in the client program, the output would be in the server window and not the client window, something like this:</p>
  
  <pre><code>#client side
  $ ls
  
  #server side
  #some results
  localhost - - [14/Feb/2013 14:26:25] "POST /RPC2 HTTP/1.0" 200 -
  </code></pre>
  
  <p>And the cd command is also broken (i.e. I couldn't change to other directories even when the command is issued). Is there any way of doing so, and if so, how?</p>