title: Starting a server instance in separate thread is not passing server object to method
body: <p>I am trying to start Stanford NLP server in one separate thread and pass the server instance as a parameter to method <code>run_nlp</code> defined in class <code>Grid</code>, which is a layout class for my python application.</p>
  
  <pre><code>from readUseCase import parser
  ...
  ...
  class Grid(Widget):
      text_from_file = ObjectProperty(None)
      client = ObjectProperty(None)
  
      def start_server(self):
          with CoreNLPClient(properties='./server.props') as self.client:
              pass
  
      def run_nlp(self):
          parser(self.client, self.text_from_file.text)
  
  class Main(App):
      def build(self):
          thread1 = threading.Thread(target=Grid().start_server)
          thread1.start()
          return Grid()
  
  if __name__ == '__main__':
      Main().run()
  </code></pre>
  
  <p>So what happens is, I start app, <code>thread</code> starts, console prints out that the server is running, my app is also running and waiting for some user input. But when I input some text for NLP and I hit a button to start method <code>run_nlp()</code>, function <code>parser()</code> needs 2 input parameters, first is the server object and second is input text.</p>
  
  <p>Function parser:</p>
  
  <pre><code>def parser(client, text):
  
      # submit the request to the server
      ann = client.annotate(text)      //AttributeError("NoneType" object has no attribute "annotate")
  </code></pre>
  
  <p>I am getting correct value in <code>self.text_from_file.text</code> parameter but I get <code>NoneType</code> for <code>self.client</code> parameter, and that is what I do not know why. I have tried to assign it to some other variable, or I tried to <code>return self.client</code> but none of this works.</p>
  
  <p>Am I calling the <code>start_server</code> right? Or where could be the problem?</p>