Lots of processes take an optional argument like:
progress (Callable[[float], None]) – Progress callback.
I was trying to implement it like this:
class ProgressPrinter( object ):
def __init__( self, name ):
self.name = name
def __call__( self, percent ):
print("%s Progress: %f%"%(self.name, percent))
sys.stdout.flush()
But that gives me an error:
RuntimeError: incomplete format
I thought that was everything needed for something to be recognized as callable. Does anyone have a working example of how to handle the progress?
Thank you!