Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write ChannelLibrary methods for terminal use #266

Open
matthewware opened this issue May 19, 2020 · 2 comments
Open

Write ChannelLibrary methods for terminal use #266

matthewware opened this issue May 19, 2020 · 2 comments
Assignees

Comments

@matthewware
Copy link
Collaborator

This is probably a corner-case for most people, but it should be easy to check the environment and format the output depending on terminal/notebook. See

display(IPHTML(f"<table><tr><th>id</th><th>Year</th><th>Date</th><th>Time</th><th>Name</th><th>Notes</th></tr><tr>{table_code}</tr></table>"))

for example.

@matthewware matthewware self-assigned this May 19, 2020
@matthewware
Copy link
Collaborator Author

ipython/ipython#9732 had a decent solution for this

ip = get_trait('kernel')
if ip:
    # in notebook
else:
    # not in notebook

@grahamrow
Copy link
Member

This can be surprisingly hard — I think there's some code already in one our packages for making this determination.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants