I am not very familiar with python/ipython but somebody was asking me whether it is possible to start an ipython notebook with a specific python file. It then could be used for debugging. another software then would create a .py-file in the temp folder and would call an ipython notebook with this file. Is it possible or does it make sense at all?
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
Since the question is quite broad and asking for recommendations, here are my suggestions:
https://github.com/takluyver/nbopen
Please note that I have one open ticket for complete Windows explorer integration:
https://github.com/takluyver/nbopen/issues/12
[copied from github page]
Installation:
Usage:
https://github.com/paulgb/runipy
[copied from github page]
Installation:
To run a .ipynb file as a script, run:
To save the output of each cell back to the notebook file, run:
To save the notebook output as a new notebook, run:
To run a .ipynb file and generate an HTML report, run:
If you're talking about launching an iPython notebook server via Python, I use this:
Obviously you can change the arguments if you so desire.
At my work we have one use case that does what you're saying--automatically generates a python file, then loads a new ipython server for the user to access it. However, it's a pretty special use case--for normal debugging, I would recommend just starting in iPython and not making your *.py file until the bugs are gone.
OR
If you're talking about actually automatically navigating to the page that corresponds to a python file made available by an ipython notebook server, then (1) make sure you're using ipython 2, and (2) figure out what you're desired url is (it should be deterministic) and (3) use the webbrowser module to navigate to that url.
To start a ipython notebook with a certain notebook directory, use the
--notebook-dir
command line option: