code: def ekopn(fname, ifname, ncomch):
      
      fname = stypes.stringToCharP(fname)
      ifname = stypes.stringToCharP(ifname)
      ncomch = ctypes.c_int(ncomch)
      handle = ctypes.c_int()
      libspice.ekopn_c(fname, ifname, ncomch, ctypes.byref(handle))
      return handle.value
docs: Open a new E-kernel file and prepare the file for writing.
  
      http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ekopn_c.html
  
      :param fname: Name of EK file.
      :type fname: str
      :param ifname: Internal file name.
      :type ifname: str
      :param ncomch: The number of characters to reserve for comments.
      :type ncomch: int
      :return: Handle attached to new EK file.
      :rtype: int