title: Empty output for NLTK function in CGI script
body: <p>I want to use python NLTK library's function in CGI script to tokenize some text, recieved via WEB.</p>
  <p>If i simply use:</p>
  <pre class="lang-py prettyprint-override"><code>someamountoftext = &quot;someamountoftext someamountoftext someamountoftext&quot;
  </code></pre>
  <p>and then</p>
  <pre class="lang-py prettyprint-override"><code> nltk.word_tokenize(someamountoftext)
  </code></pre>
  <p>or</p>
  <pre class="lang-py prettyprint-override"><code>nltk.sent_tokenize(someamountoftext)
  </code></pre>
  <p>It will work.</p>
  <p>BUT! If I use this:</p>
  <pre class="lang-py prettyprint-override"><code>#!C:\Users\HP\AppData\Local\Programs\Python\Python310-32\python.exe
  import os
  import urllib.parse
  import nltk
  query_dict = urllib.parse.parse_qs(os.environ['QUERY_STRING'])
  
  def tknz_wrd(someamountoftext):
  return(nltk.word_tokenize(someamountoftext))
  
  
  print(&quot;Content-Type: text/html\n&quot;)
  
  print (tknz_wrd(someamountoftext))
  </code></pre>
  <p>(Above is all my code of sigle file, no frameworks or something).</p>
  <p>It does not print anything on screen. No erros, just white browser screen.
  Ofcourse, I tried manual input like:</p>
  <p>http://localhost/speciallocationforproject/local/tokenize/morgot.py?someamountoftext=somekindoftext</p>
  <p>It did not change anything.</p>
  <p>morgot.py - name of my CGI file.</p>
  <p>Where is my mistake? And\or how  to make tokenization via WEB?</p>
  <p>I use: Apache/2.4.53 (Win64) OpenSSL/1.1.1n PHP/7.4.28</p>
  <p>python 3.10.4</p>