Skip to content

from IPython import get_ipython#486

Closed
cclauss wants to merge 1 commit into
TheAlgorithms:masterfrom
cclauss:patch-3
Closed

from IPython import get_ipython#486
cclauss wants to merge 1 commit into
TheAlgorithms:masterfrom
cclauss:patch-3

Conversation

@cclauss

@cclauss cclauss commented Oct 19, 2018

Copy link
Copy Markdown
Member

@harshildarji Help linters (and humans) understand where get_ipython() comes from.

$ flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics

./machine_learning/logistic_regression.py:19:1: F821 undefined name 'get_ipython'
get_ipython().run_line_magic('matplotlib', 'inline')
^
1    F821 undefined name 'get_ipython'
1

@harshildarji

Copy link
Copy Markdown
Member

@cclauss To make from IPython import get_ipython work, we will have to run our script with ipython shell. Ordinary python shell will not work. So I think it is safe to comment out that line. User can remove the comment when they try to run with ipython or maybe in the notebook.

@cclauss

cclauss commented Oct 24, 2018

Copy link
Copy Markdown
Member Author

Alternative would be to try / catch ImportError but I think we are good as is... Thanks for your guidance on getting this done.

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

Successfully merging this pull request may close these issues.

2 participants