5 # handle extra verbose input modules, only imported if we need them
7 _final_flush_plot = None
11 """Import pylab plotting functions for when we need to plot. This
12 function can be called multiple times, and ensures that the pylab
13 setup is only imported once. It defines the functions
14 _flush_plot() to be called after incremental changes,
15 _final_flush_plot(), to be called at the end of any graphical processing, and
16 _pylab, a reference to the pylab module."""
19 global _final_flush_plot
21 import pylab as _pylab
22 if _flush_plot == None :
23 if config.PYLAB_INTERACTIVE :
24 _flush_plot = _pylab.draw
26 def _flush_plot () : pass
27 if _final_flush_plot == None :
28 if config.PYLAB_INTERACTIVE :
29 _final_flush_plot = _pylab.draw
31 _final_flush_plot = _pylab.show
33 def write_array(ofile, array, seperator):
34 """Erite an iterable array seperated by seperator.
35 Terminate the output with an endline."""
36 strings = [repr(x) for x in array]
37 ofile.write(seperator.join(strings))