title: No Viable Alternative to Input '\\n" Python Error
body: <p>I am working on a large scale project that involves giving a python script a first name and getting back a result as to what kind of gender it belongs to. My current program is written in Java and using Jython to interact with a Python script called "sex machine." It works great in most cases and I've tested it with smaller groups of users. However, when I attempt to test it with a large group of users the program gets about halfway in and then gives me the following error:</p>
  
  <pre><code>"Exception in thread "main" SyntaxError: No viable alternative to input '\\n'", ('&lt;string&gt;', 1, 22, "result = d.get_gender('Christinewazonek'')\n")
  </code></pre>
  
  <p>I am more accustomed to Java and have limited knowledge of Python so at the moment I don't know how to solve this problem. I tried to trim the string that I'm giving the get_gender method but that didn't help any. I am not sure what the numbers 1, 22 even mean.</p>
  
  <p>Like I said since I'm using Jython my code would be the following:</p>
  
  <pre><code>static PythonInterpreter interp = new PythonInterpreter();
  
  
  interp.exec("import sys, os.path");
  interp.exec("sys.path.append('/Users/myname/Desktop/')");
  interp.exec("import sexmachine.detector as gender");
  
  interp.exec("d = gender.Detector()");
  
  interp.exec("result = d.get_gender('"+WordUtils.capitalize(name).trim()
              +"')");
  
  PyObject gendAnswer = interp.get("result");
  </code></pre>
  
  <p>And this is pretty much the extent of Jython/Python interaction in my Java code. If someone sees something that's wrong or not right I would certainly appreciate if you could help me. As this is a large project it takes time to run the whole program again only to run into the same issue, so because of this I really need to fix this problem.</p>