# REPL While It Works: Inspect a Running Python Program Without Pausing It

DevFeed: [REPL While It Works: Inspect a Running Python Program Without Pausing It](<https://devfeed.tech/articles/repl-while-it-works-inspect-a-running-python-program-without-pausing-it-106888.md>)

Original publisher: [Read original article](<https://hackernoon.com/repl-while-it-works-inspect-a-running-python-program-without-pausing-it?source=rss>)

Author: David Kra

Published: 2026-10-29T18:12:39Z

Content type: tutorial

Language: en

Sources: [HackerNoon](<https://devfeed.tech/sources/hackernoon.md>)

Topics: [Python](<https://devfeed.tech/topics/python.md>), [async](<https://devfeed.tech/topics/async.md>), [IPython](<https://devfeed.tech/topics/ipython.md>), [execution](<https://devfeed.tech/topics/execution.md>)

Tags: [coding](<https://devfeed.tech/tags/coding.md>), [concurrently](<https://devfeed.tech/tags/concurrently.md>), [console](<https://devfeed.tech/tags/console.md>), [debugger](<https://devfeed.tech/tags/debugger.md>), [debugging](<https://devfeed.tech/tags/debugging.md>), [execution](<https://devfeed.tech/tags/execution.md>), [python](<https://devfeed.tech/tags/python.md>), [python-developers](<https://devfeed.tech/tags/python-developers.md>), [python-inspection](<https://devfeed.tech/tags/python-inspection.md>), [python-pdb](<https://devfeed.tech/tags/python-pdb.md>), [python-programming](<https://devfeed.tech/tags/python-programming.md>), [repl](<https://devfeed.tech/tags/repl.md>), [threading](<https://devfeed.tech/tags/threading.md>)

## AI overview

The technique runs application work in worker threads while the main thread offers interactive Python access, so you can inspect shared state and call functions such as `analyze()` without pausing the work. The example stores pseudo-global objects as attributes on a function, starts daemon threads, then alternates between PDB (`continue` to leave) and a REPL (`Ctrl-D` to leave). The author used this approach during a multi-hour Gmail IMAP job collecting sender and message-size data across about 100,000 emails, running analysis to see leading senders by total bytes while collection continued. The article frames the method for personal programs whose data and functions are not generally known to others.

## Source excerpt

Use the python REPL or debugger console while a program is running, without interrupting or pausing execution. Exploit threading multitasking.