Run a function call with assignment in the background.
Useful for putting time-consuming calculations/graphics
in the background in an interactive Python shell. >>> b=BG(f , g.gridloop, 'sin(xy)-exp(-xy)')
>>> b.start()
running gridloop('sin(xy)-exp(-xy)',) in a thread
>>> # continue with other interactive tasks
>>> b.finished
True
>>> b.f # result of function call
Methods
|
|
__init__
run
|
|
__init__
|
__init__ (
self,
result='result',
func=None,
args=[],
kwargs={},
)
|
|
run
|
run ( self )
|
|