Automatic Jupyter environment detection
See original GitHub issueSomething similar to tqdm’s auto
module would be helpful. This would mean I can run the same code in Jupyter or a terminal and get the same rich
experience.
Basically, it would just be a small wrapper that does a simple check to whether or not we are in an IPython environment or a regular Python one, and then import the console
and print
objects from the correct package. Then you could write code like this, knowing it would work wherever it was run:
from rich.auto import print
print("[bold magenta]Hello, world![\]")
Alternatively you could put this functionality into the default imports; I’m not sure why you would ever not want this (other than to avoid the overhead of checking, but that’s fairly minimal).
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:10
Top Results From Across the Web
Automatic Environment Kernel Detection for Jupyter - GitHub
A Jupyter plugin to enable the automatic detection of environments as kernels. This plugin looks in the directories you specify for installed environments...
Read more >Get Your Conda Environment to Show in Jupyter Notebooks
To get your other environment kernels to show automatically: 1. First, install nb_conda_kernels in your base environment. Once this is installed ...
Read more >Automatic Environment Kernel Detection For Jupyter - Morioh
A Jupyter plugin to enable the automatic detection of environments as kernels. This plugin looks in the directories you specify for installed environments...
Read more >How to Automate a Jupyter Notebook? | Analytics Vidhya
Anyone looking to run a Jupyter Notebook automatically within your PC, I have a solution in 5 simple steps! Pipeline: CronTab ->Bash Script...
Read more >How to enable auto-completion in Jupyter Notebook
You have auto-complete in Jupyter notebooks like you have in any other Jupyter environment. Simply hit the “Tab” key while writing code.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For those interested, I have a ‘jupyter’ branch with improved Jupyter support.
It’s completely transparent now. The same imports and API will work in the terminal and notebook. Here is a screenshot:
Yeah, I think I could do something along those lines.