0

Maybe it's a duplicate from this: Suppress calls to print (python), but the answer given isn't helping me, so I wondered if I'm dealing with something else.

I'm using the package savReaderWriter for Python to write data to an SPSS-file. This is going great, but when I'm writing a lot of records a method in the package starts printing lines to indicate the progress. While this may sound great at first, it's polluting my console because it's writing every 1% of progess on a new row.

You can find a snippet of the code that's called in package here: http://code.activestate.com/recipes/577811-python-reader-writer-for-spss-sav-files-linux-mac-/ and the method used is printPctProgress().

My code, that calls the package looks like this:

with savReaderWriter.SavWriter(savFileName, savFileHeader, savVarTypes) as writer:
    writer.writerows(savFileData)

I would like to supress the printing done by method printPctProgress() from the package. Any ideas?

Bas
  • 1,232
  • 1
  • 12
  • 26
  • 1
    The solution provided in your link should still work: https://stackoverflow.com/a/45669280/6701771 – Mart R Dec 10 '18 at 13:02
  • Ran a few more test cases and I thought it was only printing when it was writing, but I was also reading a file a few lines earlier. Apparantly that's where the print came from... So it is indeed a duplicate, my bad – Bas Dec 10 '18 at 13:16

0 Answers0