How to compute MOSFET gate charge loss power using Python
You can use the UliEngineering library to compute the power lost to charging a particular MOSFET to a particular gate voltage a given number of times a second:
from UliEngineering.Electronics.MOSFET import mosfet_gate_charge_losses
from UliEngineering.EngineerIO import auto_format
auto_format(mosfet_gate_charge_losses, "31nC", "9V", "1MHz")
# Prints '279 mW'