#Fixme: to be documented, improved
This example shows how to pass raw spice definitions to a netlist.
import PySpice.Logging.Logging as Logging
logger = Logging.setup_logging()
from PySpice import Circuit
from PySpice.Unit import *
Let define a circuit.
circuit = Circuit('Test')
Pass raw Spice definitions to a circuit, aka netlist, content is inserted at the beginning of the netlist.
circuit.raw_spice = '''
Vinput in 0 10V
R1 in out 9kOhm
'''
Pass element parameters as raw Spice, content is concatenated with [R2 out 0]{.title-ref}
circuit.R(2, 'out', 0, raw_spice='1k')
print(circuit)
.title Test Vinput in 0 10V R1 in out 9kOhm R2 out 0 1k