title: Convert numpy array to MemoryView object
body: <p>I'm trying to convert a numpy array to a <code>MemoryView</code> object because I have to communicate between two programs. The one can only handle NumPy arrays and the other only MemoryView objects.</p>
  
  <p>Converting from MemoryView to numpy array is easily done by:</p>
  
  <pre><code>import numpy as np
  MyNumpyArray=np.array(MyMemoryView)
  </code></pre>
  
  <p>But how do you convert from numpy array to MemoryView?</p>
  
  <p>I found here: <a href="https://docs.python.org/3/c-api/memoryview.html" rel="nofollow noreferrer">https://docs.python.org/3/c-api/memoryview.html</a> That there's a PyMemoryView_FromObject(PyObject *obj) function, but I don't know how to call it without an example.</p>
  
  <p>Thanks!</p>