NgspiceProtocol uses an instance of me to make lines of text for Ngspice commands.

Instance Variable lastLine The line of text I produced most recently, or None if no line ever produced yet.
Method __init__ Undocumented
Method format Formats x into a string in a way that Ngspice will like.
Method __call__ Call my instance to get a line of text for an Ngspice command from a list of args and a dict of params.
Method last Returns the last (i.e., most recent) line of text I've produced, with the trailing stripped off, or None if I haven't produced any lines yet.
lastLine =
The line of text I produced most recently, or None if no line ever produced yet.
def __init__(self):
Undocumented
def format(self, x):

Formats x into a string in a way that Ngspice will like.

Floats are shown with all legit decimal digits to convey a double-precision value. Booleans are represented as "1" or "0". And of course strings remain strings.

def __call__(self, args, params):

Call my instance to get a line of text for an Ngspice command from a list of args and a dict of params.

The args are each formatted with format and separated by spaces. Any params are converted to "x=y" format, with "x" being the parameter name and "y" being its string-formatted value.

The line is terminated with a newline.

def last(self):

Returns the last (i.e., most recent) line of text I've produced, with the trailing stripped off, or None if I haven't produced any lines yet.

API Documentation for pingspice, generated by pydoctor at 2021-09-18 08:41:11.