Re:Advanced computing with IPython
by spot on Tuesday June 05, 2018 @03:03PM
(#17240927)
http://ipython.readthedocs.io/en/stable/config/options/termi...
[ Parent
| on HN ]
Re:Advanced computing with IPython
by Bromskloss on Tuesday June 05, 2018 @04:22PM
(#17241659)
My problem is that I don't know how to make it accept spaces in the command to be run. This works:
ipython3 --InteractiveShellApp.exec_lines='["print(2)"]'
This does not work: ipython3 --InteractiveShellApp.exec_lines='["from math import *"]'
The latter command results in the following error: [TerminalIPythonApp] CRITICAL | The 'exec_lines' trait of a TerminalIPythonApp instance must be a list, but a value of class 'str' (i.e. '["from') was specified.Rather than fiddling around with quoting bash, you can put the import line in a startup file: http://ipython.readthedocs.io/en/stable/interactive/tutorial...
idk, it works for me:
$ ipython3 --InteractiveShellApp.exec_lines='["from math import *"]'
Python 3.6.5 |Anaconda, Inc.| (default, Apr 26 2018, 08:42:37)
Type 'copyright', 'credits' or 'license' for more information
IPython 6.4.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: sin(5)
Out[1]: -0.9589242746631385
Re:Advanced computing with IPython
by Bromskloss on Tuesday June 05, 2018 @05:12PM
(#17242119)
I see. I have iPython 5.1.0. Maybe there was a bug that has been fixed in yours.