How do I import Mission Planner libraries for Python coding?

I’ve been trying to figure out how to code Python for Mission Planner for about 8 hours now. I admit that I’m not a professional or hobbyist coder and that it’s my first time using Python, but I managed to write a working version of Tetris in Visual Basic back in my youth, and I at least got a tutorial Python program to work. I’ve built a quadcopter from individual components and it flies. I also got Mission Planner to run a very basic Takeoff-Hover-Land program. I have a more specific autonomous flight I’d like to run, however, and as simple as the pseudocode is, what I’d like it to do seems outside the scope of Mission Planner’s Flight Plan options. That’s why I’m looking into Python. I downloaded Python 2.7 and IntelliJ to use as a GUI. I’m using Mission Planner 1.3.18 and ArduPilot 3.2.1. (I’m using APM 2.5, so I’m using older software versions to be safe).

I have looked at every single Python script I could Google (and it’s not that many), and they seem to all start with the following:
import sys
import clr
import time
import MissionPlanner # import *

I don’t know what clr is, but IntelliJ should let me know if it doesn’t get used. I’m pretty sure sys and time are standard libraries from Python. MissionPlanner is clearly an important library, but IntelliJ, for obvious reasons, doesn’t recognize it. I don’t know where the MissionPlanner library is or what it’s called, despite searching my hard drive and making educated guesses. I think I can figure out how to add the library to what I’m working on in IntelliJ- I realize this is not an IntelliJ forum, but I really need someone to let me know what the library file is called. I wouldn’t be surprised if it was “MissionPlanner.something”, and I just didn’t recognize it as a library file because I’m not a serious coder.

By the way, if you’re interested, my quad is going to be ejected from a rocket and then land autonomously. It should be pretty simple to code. My flight plan is as follows:

  1. Standby for up to two hours (no propeller movement)
  2. Identify when altitude > 3000 feet. (still on standby- no propeller movement)
  3. If altitude < 3000 feet, land
  4. If altitude < 300 feet, disarm (yeah, I know- it’s going to free fall for 300 feet- it’ll have a parachute)
    I might add to the code, depending on FAA regulations, but for now I’d just like to get that code working. I just can’t seem to get started on the Python. Thanks for your help- I wouldn’t be asking for help if I hadn’t spent so much time searching for the answer on my own.

MP uses ironpython internally. and the missionplanner import is a pseudo class. it doesn’t actually exist in python at all.

you could create a fake file for your debugging of your script however though.