pyline icon indicating copy to clipboard operation
pyline copied to clipboard

ENH,UBY: pyline.main(output=None)

Open westurner opened this issue 9 years ago • 0 comments

When working with the pyline.pyline.main() function, it's often not necessary to print the results (e.g. when they're appended to to results and the utilized in a downstream function); there should be a way to not write to stdout or stderr (or a stringio.StringIO (Python 2), io.StringIO).

solution:

With NotImplemented as a default value

  • [ ] def pyline(output=NotImplemented)
  • [ ] if not output:
    • don't write sys.stdout
  • [ ] elif output is NotImplemented:
    • write to sys.stdout (by default)

workaround:

  • output=sys.stderr
  • output=io.StringIO

westurner avatar Jun 19 '16 03:06 westurner