-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
IPython console run code lines not being saved in preferences #3354
Comments
Thank you for your report. This issue is still present in the latest version. The problem is that when loading the config file, the string is |
@jitseniesen, the problem is settings location changed in the transition from IPython to Jupyter. I think I already fixed this error in PR #2878 ;-) |
Using eval() has unintended side-effects. Instead, do nothing if we expect a string, and use ast.literal_eval() for other types (list, tuple, etc.) Fixes spyder-ide#3354.
It looks like there several problems. I don't think your PR fixes the issue described here; I tried it the steps under "What steps will reproduce the problem?" with your branch and the issue persists. It has to do with the config system and not with the IPython plugin. |
Ok, I see. Then please go ahead and fix it :-) |
Using eval() has unintended side-effects. Instead, do nothing if we expect a string, and use ast.literal_eval() for other types (list, tuple, etc.) Fixes spyder-ide#3354.
Using eval() has unintended side-effects. Instead, do nothing if we expect a string, and use ast.literal_eval() for other types (list, tuple, etc.) Fixes spyder-ide#3354.
Using eval() has unintended side-effects. Instead, do nothing if we expect a string, and use ast.literal_eval() for other types (list, tuple, etc.) Fixes spyder-ide#3354.
Description of your problem
I am running Spyder 2.3.9 on Windows 7, using the Anaconda Python 3.5.2 distribution. Anaconda is up to date on my system. I can't get Spyder to remember "run code" preference for ipython console. In particular, using the Spyder gui, I click on Tools -> Preferences -> IPython console -> Startup tab. I enter something in the Run code lines: dialog, like print('hello world'). Click Apply, OK. If I go back to preferences, this box is empty. If I start an ipython console, the print statement isn't executed.
The specific problem that got me on this is setting how floating-point numbers are formatted. By default, ipython in Spyder doesn't use scientific notation until many decimal places. I wanted to add the ipython magic command '%precision %.4g'. Can't add it to run code lines dialog. Added to my ipython_config.py, works when I start a free-standing ipython from a prompt. Not in Spyder.
What steps will reproduce the problem?
Versions and main components
Dependencies
Please go to the menu entry
Help > Optional Dependencies
(orHelp > Dependencies
), press the buttonCopy to clipboard
and paste the contents below:
IPython >=1.0 : 5.0.0 (OK)
jedi >=0.8.1;<0.9.0: 0.9.0 (NOK)
matplotlib >=1.0 : 1.5.1 (OK)
pandas >=0.13.1 : 0.18.1 (OK)
pep8 >=0.6 : 1.7.0 (OK)
pyflakes >=0.6.0 : 1.2.3 (OK)
pygments >=1.6 : 2.1.3 (OK)
pylint >=0.25 : None (NOK)
qtconsole >=4.0 : 4.2.1 (OK)
rope >=0.9.2 : 0.9.4-1 (OK)
sphinx >=0.6.6 : 1.3.1 (OK)
sympy >=0.7.3 : 1.0 (OK)
zmq >=2.1.11 : 15.4.0 (OK)
The text was updated successfully, but these errors were encountered: