On 1/28/2016 11:57 PM, Steven D'Aprano wrote:
On Fri, 29 Jan 2016 06:04 pm, Mike S wrote:
%matplotlib inline
I get an error on the last line. I am running this code in Idle Python
3.4.4 Shell...
Python 3.4.4 (v3.4.4:737efcadf5a6, Dec 20 2015, 19:28:18) [MSC v.1600 32
bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> import numpy as np
>>> import pandas as pd
>>> import random
>>> import matplotlib.pyplot as plt
>>> %matplotlib inline
SyntaxError: invalid syntax
What am I doing wrong? Suggested reading?
That %matplotlib looks to me like iPython "magic" -- yes, that's the
official name for it. It's not real Python code, and won't run in a regular
Python interpreter like IDLE.
IPython is a custom Python interactive interpreter. As well as running
regular Python code, it includes special syntax for magic such as:
%cd
%run
%bg
and many more.
http://ipython.org/ipython-doc/rel-0.10.2/html/interactive/reference.html#magic
You could try installing iPython and running the tutorial examples in that,
or perhaps finding a better tutorial that actually bothers to mention what
it needs to run.
(You have read the tutorial from the beginning, yes?)
Thank you Chris and Steven, I'll see if I can get iPython running and do
a tutorial.
--
https://mail.python.org/mailman/listinfo/python-list