title: How to read text directly from screen using python
body: <p>I want to build  project  that reads texts continuously from part of my pc screen and shows them on the console of pycharm</p>
  <p>I am using python 3, all modules are installed using pip from pycharm console.</p>
  <p>I used this code:</p>
  <pre><code>import time
  import cv2
  import mss
  import numpy
  import pytesseract
  
  
  mon = {'top': 0, 'left': 0, 'width': 150, 'height': 150}
  
  with mss.mss() as sct:
      while True:
          im = numpy.asarray(sct.grab(mon))
          # im = cv2.cvtColor(im, cv2.COLOR_BGR2GRAY)
  
          text = pytesseract.image_to_string(im)
          print(text)
  
          cv2.imshow('Image', im)
  
          # Press &quot;q&quot; to quit
          if cv2.waitKey(25) &amp; 0xFF == ord('q'):
              cv2.destroyAllWindows()
              break
  
          # One screenshot per second
          time.sleep(1)
  </code></pre>
  <p>got this error which I couldn't deal with :</p>
  <pre><code>C:\Users\ali91\PycharmProjects\OCR\venv\Scripts\python.exe
  &quot;C:/Users/ali91/PycharmProjects/OCR/lesson 1.py&quot; Traceback (most
  recent call last):   File
  &quot;C:\Users\ali91\PycharmProjects\OCR\venv\lib\site-packages\pytesseract\pytesseract.py&quot;,
  line 252, in run_tesseract
      proc = subprocess.Popen(cmd_args, **subprocess_args())   File &quot;C:\Program Files\Python39\lib\subprocess.py&quot;, line 947, in __init__
      self._execute_child(args, executable, preexec_fn, close_fds,   File &quot;C:\Program Files\Python39\lib\subprocess.py&quot;, line 1416, in
  _execute_child
      hp, ht, pid, tid = _winapi.CreateProcess(executable, args, FileNotFoundError: [WinError 2] The system cannot find the file
  specified
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):   File
  &quot;C:\Users\ali91\PycharmProjects\OCR\lesson 1.py&quot;, line 15, in &lt;module&gt;
      text = pytesseract.image_to_string(im)   File &quot;C:\Users\ali91\PycharmProjects\OCR\venv\lib\site-packages\pytesseract\pytesseract.py&quot;,
  line 413, in image_to_string
      return {   File &quot;C:\Users\ali91\PycharmProjects\OCR\venv\lib\site-packages\pytesseract\pytesseract.py&quot;,
  line 416, in &lt;lambda&gt;
      Output.STRING: lambda: run_and_get_output(*args),   File &quot;C:\Users\ali91\PycharmProjects\OCR\venv\lib\site-packages\pytesseract\pytesseract.py&quot;,
  line 284, in run_and_get_output
      run_tesseract(**kwargs)   File &quot;C:\Users\ali91\PycharmProjects\OCR\venv\lib\site-packages\pytesseract\pytesseract.py&quot;,
  line 256, in run_tesseract
      raise TesseractNotFoundError() pytesseract.pytesseract.TesseractNotFoundError: tesseract is not
  installed or it's not in your PATH. See README file for more
  information.
  </code></pre>