code: def spkw12(handle, body, center, inframe, first, last, segid, degree, n, states,
             epoch0, step):
      
      handle = ctypes.c_int(handle)
      body = ctypes.c_int(body)
      center = ctypes.c_int(center)
      inframe = stypes.stringToCharP(inframe)
      first = ctypes.c_double(first)
      last = ctypes.c_double(last)
      segid = stypes.stringToCharP(segid)
      degree = ctypes.c_int(degree)
      n = ctypes.c_int(n)
      states = stypes.toDoubleMatrix(states)  # X by 6 array
      epoch0 = ctypes.c_double(epoch0)
      step = ctypes.c_double(step)
      libspice.spkw12_c(handle, body, center, inframe, first, last, segid, degree,
                        n, states, epoch0, step)
docs: Write a type 12 segment to an SPK file.
  
      http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/spkw12_c.html
  
      :param handle: Handle of an SPK file open for writing.
      :type handle: int
      :param body: NAIF code for an ephemeris object.
      :type body: int
      :param center: NAIF code for center of motion of body.
      :type center: int
      :param inframe: Reference frame name.
      :type inframe: str
      :param first: Start time of interval covered by segment.
      :type first: float
      :param last: End time of interval covered by segment.
      :type last: float
      :param segid: Segment identifier.
      :type segid: str
      :param degree: Degree of interpolating polynomials.
      :type degree: int
      :param n: Number of states.
      :type n: int
      :param states: Array of states.
      :type states: Nx6-Element Array of floats
      :param epoch0: Epoch of first state in states array.
      :type epoch0: float
      :param step: Time step separating epochs of states.
      :type step: float