ayi https://github.com/wakepy/wakepy $ pip install wakepy from wakepy import keep with keep.presenting(): ... It does the same thing @FranckDernoncourt did but is cross-platform and concise. I always use with keep.running(): because I'm not interested in imaging or progress-reporting, just need results of long computation.