def splinteractive(xdata, ydata, smoothing=<NUM_LIT>, degree=<NUM_LIT:5>, presmoothing=<NUM_LIT:0>, spline_class=spline_single, xlabel="<STR_LIT:x>", ylabel="<STR_LIT:y>", show_derivative=<NUM_LIT:1>, boost_factor=<NUM_LIT>, xmin="<STR_LIT>", xmax="<STR_LIT>"):
while True:        <EOL><INDENT>x_spline = spline_class(xdata, ydata, smoothing, degree, presmoothing, True, xlabel, ylabel, show_derivative, xmin=xmin, xmax=xmax)<EOL>if x_spline.message == "<STR_LIT>": command = input("<STR_LIT>")<EOL>else:                      command = x_spline.message<EOL>try:<EOL><INDENT>float(command)<EOL>command = "<STR_LIT>"+command<EOL><DEDENT>except:<EOL><INDENT>print("<STR_LIT>")<EOL><DEDENT>if   command in ["<STR_LIT:y>", "<STR_LIT:Y>", "<STR_LIT:yes>"]:<EOL><INDENT>x_spline.message = "<STR_LIT>"<EOL>smoothing = x_spline.smoothing<EOL>return x_spline<EOL><DEDENT>elif command in ["<STR_LIT:n>", "<STR_LIT:N>", "<STR_LIT>"]:<EOL><INDENT>x_spline.message = "<STR_LIT>"<EOL>smoothing = x_spline.smoothing<EOL>return x_spline<EOL><DEDENT>elif command in ["<STR_LIT:q>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>"]:<EOL><INDENT>x_spline.message = "<STR_LIT>"<EOL>smoothing = x_spline.smoothing<EOL>return x_spline<EOL><DEDENT>elif command in ["<STR_LIT:l>", "<STR_LIT:L>", "<STR_LIT>"]:<EOL><INDENT>x_spline.message = "<STR_LIT>"<EOL>smoothing = x_spline.smoothing<EOL>x_spline.plot()<EOL>input("<STR_LIT>")<EOL><DEDENT>elif command in ["<STR_LIT:d>", "<STR_LIT:D>", "<STR_LIT>", "<STR_LIT:\n>"]:<EOL><INDENT>x_spline.message = "<STR_LIT>"<EOL>smoothing = x_spline.smoothing<EOL>x_spline.plot(derivative=<NUM_LIT:1>)<EOL>input("<STR_LIT>")<EOL><DEDENT>elif command in ["<STR_LIT>", "<STR_LIT>"]:<EOL><INDENT>x_spline.message = "<STR_LIT>"<EOL>x_spline.plot(derivative=<NUM_LIT:2>)<EOL>smoothing = x_spline.smoothing<EOL>input("<STR_LIT>")<EOL><DEDENT>elif command in ["<STR_LIT:p>", "<STR_LIT:P>", "<STR_LIT>", "<STR_LIT>"]:<EOL><INDENT>x_spline.message = "<STR_LIT>"<EOL>smoothing = x_spline.smoothing<EOL>_s.printer()<EOL><DEDENT>elif command == "<STR_LIT:[>":<EOL><INDENT>x_spline.message = "<STR_LIT>"<EOL>smoothing = smoothing / boost_factor<EOL><DEDENT>elif command == "<STR_LIT:]>":<EOL><INDENT>x_spline.message = "<STR_LIT>"<EOL>smoothing = smoothing * boost_factor<EOL><DEDENT>elif command.split("<STR_LIT:=>")[<NUM_LIT:0>].strip() in ["<STR_LIT:s>", "<STR_LIT>"]:<EOL><INDENT>try: smoothing = eval(command.split("<STR_LIT:=>")[<NUM_LIT:1>].strip())<EOL>except: print("<STR_LIT>")<EOL><DEDENT>elif command.split("<STR_LIT:=>")[<NUM_LIT:0>].strip() in ["<STR_LIT:d>", "<STR_LIT>"]:<EOL><INDENT>try: degree = int(eval(command.split("<STR_LIT:=>")[<NUM_LIT:1>].strip()))<EOL>except: print("<STR_LIT>")<EOL><DEDENT>elif command.split("<STR_LIT:=>")[<NUM_LIT:0>].strip() in ["<STR_LIT:p>", "<STR_LIT>", "<STR_LIT>"]:<EOL><INDENT>try: presmoothing = int(eval(command.split("<STR_LIT:=>")[<NUM_LIT:1>].strip()))<EOL>except: print("<STR_LIT>")<EOL><DEDENT>elif command.split("<STR_LIT:=>")[<NUM_LIT:0>].strip() in ["<STR_LIT:b>", "<STR_LIT>"]:<EOL><INDENT>try: boost_factor = float(eval(command.split("<STR_LIT:=>")[<NUM_LIT:1>].strip()))<EOL>except: print("<STR_LIT>")<EOL><DEDENT>else:<EOL><INDENT>print("<STR_LIT>")<EOL>print("<STR_LIT>")<EOL>print("<STR_LIT>")<EOL>print("<STR_LIT>")<EOL>print("<STR_LIT>")<EOL>print("<STR_LIT>")<EOL>print("<STR_LIT>")<EOL>print("<STR_LIT>")<EOL>print("<STR_LIT>")<EOL>print("<STR_LIT>")<EOL>print("<STR_LIT>")<EOL>print("<STR_LIT>")<EOL>print("<STR_LIT>")<EOL>smoothing = x_spline.smoothing<EOL><DEDENT><DEDENT>
Give this function x and y data to spline fit and it will fit it, returning an instance of
spline_single.  It will also ask you if it's okay and you can play with parameters.