I have a python script that accepts input on stdin. I would like to go to IPython.embed (), for example:
for filepath in sys.stdin: dir = os.path.basename(filepath) ... IPython.embed()
Then I invoke the script as follows:
find . -type f | thescript.py
The problem is that IPython uses stdin for the interactive console, so the first thing it sees is the remaining pipe data. Then the pipe closes and the terminal exits.
Is there a way to debug a script that uses stdin with ipython?
Reece
source share