-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Set pd.options.display.max_columns=0 by default #17023
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
Changes from all commits
34999f0
31951f9
863112a
f44adce
2e85f48
8fda805
0e7bac8
b87cef1
e2e2714
e3abd9a
857f2ca
ed44504
dc64c52
cb2eb3e
3cf51ca
1eb3dad
d01c682
308be12
e77eb55
ab63657
f795914
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ | |
import sys | ||
import shutil | ||
|
||
__all__ = ['get_terminal_size'] | ||
__all__ = ['get_terminal_size', 'is_terminal'] | ||
|
||
|
||
def get_terminal_size(): | ||
|
@@ -48,6 +48,23 @@ def get_terminal_size(): | |
return tuple_xy | ||
|
||
|
||
def is_terminal(): | ||
""" | ||
Detect if Python is running in a terminal. | ||
|
||
Returns True if Python is running in a terminal or False if not. | ||
""" | ||
try: | ||
ip = get_ipython() | ||
except NameError: # assume standard Python interpreter in a terminal | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. don’t you need to import this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, this is available in IPython. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I.e. when you run IPython There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. got it, this is ok then. |
||
return True | ||
else: | ||
if hasattr(ip, 'kernel'): # IPython as a Jupyter kernel | ||
return False | ||
else: # IPython in a terminal | ||
return True | ||
|
||
|
||
def _get_terminal_size_windows(): | ||
res = None | ||
try: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add this PR number here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did you push the new change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed I forgot to push, the PR number is now a few lines below.