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

display some HTML object doesn't get any useful output in IPython console #291

Closed
taoluo opened this issue Mar 31, 2016 · 9 comments
Closed

Comments

@taoluo
Copy link

taoluo commented Mar 31, 2016

PR #289 introduces a new issue to me. that is when working with IPython console, display some HTML object doesn't get any useful output, it looks like this:
image

@taoluo
Copy link
Author

taoluo commented Mar 31, 2016

@twiecki What if use display(df) instead of display(df.to_html()),
for notebook:
image
for IPython console:
image
Now, they are both happy;)

@twiecki
Copy link
Contributor

twiecki commented Mar 31, 2016

@mickeydonkey Thanks for looking into that, will change. Do we even need the get_ipython() hack then?

@twiecki
Copy link
Contributor

twiecki commented Mar 31, 2016

Did you check whether that works from inside a function?

@taoluo
Copy link
Author

taoluo commented Mar 31, 2016

I checked the following code for print inside a function, and it works as before:

from IPython.display import display
df = pd.DataFrame([1,2],[3,4])
def smart_print(a):
    display(pd.DataFrame([1,2],[3,4]))
smart_print(df)

@taoluo
Copy link
Author

taoluo commented Mar 31, 2016

and we don't need get_ipython() now.

@twiecki
Copy link
Contributor

twiecki commented Mar 31, 2016

Sweet! Want to do a PR?

@taoluo
Copy link
Author

taoluo commented Mar 31, 2016

Sorry, I haven't make any commit yet. in addition, I am not familiar with code styling stuff like PEP8. So you'd better fix it yourself. Thanks

@taoluo
Copy link
Author

taoluo commented Mar 31, 2016

though I do hope I could contribute the code.....

@twiecki
Copy link
Contributor

twiecki commented Mar 31, 2016

Much simpler, thanks for your help!

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