Reputation: 2021
The use case is the following:
What I have tried so far:
jupyter nbconvert --to python --stdout .\some_nb.ipynb | python
some_nb.ipynb
awaits for arguments via argparse
so normally I would do something like:
python some_nb.py --argument_one=1
When I do that:
jupyter nbconvert --to python --stdout .\some_nb.ipynb | python --argument_one=1
argument_one
is of course binded to python
and I am not sure how to properly pipeline this.
Upvotes: 1
Views: 161
Reputation: 2021
Finally got it. Python has -
argument after which it reads arguments from stdin
https://docs.python.org/3/using/cmdline.html
jupyter nbconvert --to python --stdout .\some_nb.ipynb| python - --argument_one=1
Upvotes: 1