In [ ]:
import time
time.sleep(10)

In [6]:
pwd


Out[6]:
u'C:\\Users\\z52380\\Documents\\IPython Notebooks'

In [18]:
ls


 驱动器 C 中的卷没有标签。
 卷的序列号是 9081-4EF4

 C:\Users\z52380\Documents\IPython Notebooks 的目录

2014/12/27  16:18    <DIR>          .
2014/12/27  16:18    <DIR>          ..
2014/12/27  16:21    <DIR>          .ipynb_checkpoints
2014/12/25  14:36            80,586 basic-output.ipynb
2014/12/25  15:36               377 data.csv
2014/12/27  16:39             3,308 markdown.ipynb
2014/12/25  16:19         8,068,829 rich-display.ipynb
               4 个文件      8,153,100 字节
               3 个目录  2,224,832,512 可用字节

In [8]:
message = 'The IPython notebook is great!'
# note: the echo command does not run on Windows, it's a unix command.
!echo $message


The IPython notebook is great!

In [12]:
import numpy
numpy.random.rand()


Out[12]:
0.5532584448507595

In [30]:
%matplotlib inline

In [31]:
import matplotlib.pyplot as plt
import numpy as np

In [32]:
x = np.linspace(0, 3*np.pi, 500)
plt.plot(x, np.sin(x**2))
plt.title('A simple chirp');



In [33]:
%load http://matplotlib.sourceforge.net/mpl_examples/pylab_examples/integral_demo.py


---------------------------------------------------------------------------
IOError                                   Traceback (most recent call last)
<ipython-input-33-09d1c4790d8b> in <module>()
----> 1 get_ipython().magic(u'load http://matplotlib.sourceforge.net/mpl_examples/pylab_examples/integral_demo.py')

C:\Anaconda\lib\site-packages\IPython\core\interactiveshell.pyc in magic(self, arg_s)
   2203         magic_name, _, magic_arg_s = arg_s.partition(' ')
   2204         magic_name = magic_name.lstrip(prefilter.ESC_MAGIC)
-> 2205         return self.run_line_magic(magic_name, magic_arg_s)
   2206 
   2207     #-------------------------------------------------------------------------

C:\Anaconda\lib\site-packages\IPython\core\interactiveshell.pyc in run_line_magic(self, magic_name, line)
   2124                 kwargs['local_ns'] = sys._getframe(stack_depth).f_locals
   2125             with self.builtin_trap:
-> 2126                 result = fn(*args,**kwargs)
   2127             return result
   2128 

C:\Anaconda\lib\site-packages\IPython\core\magics\code.pyc in load(self, arg_s)

C:\Anaconda\lib\site-packages\IPython\core\magic.pyc in <lambda>(f, *a, **k)
    191     # but it's overkill for just that one bit of state.
    192     def magic_deco(arg):
--> 193         call = lambda f, *a, **k: f(*a, **k)
    194 
    195         if callable(arg):

C:\Anaconda\lib\site-packages\IPython\core\magics\code.pyc in load(self, arg_s)
    305                              'or macro.')
    306 
--> 307         contents = self.shell.find_user_code(args)
    308 
    309         if 's' in opts:

C:\Anaconda\lib\site-packages\IPython\core\interactiveshell.pyc in find_user_code(self, target, raw, py_only, skip_encoding_cookie)
   3128         try:
   3129             if utarget.startswith(('http://', 'https://')):
-> 3130                 return openpy.read_py_url(utarget, skip_encoding_cookie=skip_encoding_cookie)
   3131         except UnicodeDecodeError:
   3132             if not py_only :

C:\Anaconda\lib\site-packages\IPython\utils\openpy.pyc in read_py_url(url, errors, skip_encoding_cookie)
    213     except ImportError:
    214         from urllib import urlopen
--> 215     response = urlopen(url)
    216     buffer = io.BytesIO(response.read())
    217     return source_to_unicode(buffer, errors, skip_encoding_cookie)

C:\Anaconda\lib\urllib.pyc in urlopen(url, data, proxies)
     85         opener = _urlopener
     86     if data is None:
---> 87         return opener.open(url)
     88     else:
     89         return opener.open(url, data)

C:\Anaconda\lib\urllib.pyc in open(self, fullurl, data)
    206         try:
    207             if data is None:
--> 208                 return getattr(self, name)(url)
    209             else:
    210                 return getattr(self, name)(url, data)

C:\Anaconda\lib\urllib.pyc in open_http(self, url, data)
    357         else:
    358             if data is None:
--> 359                 return self.http_error(url, fp, errcode, errmsg, headers)
    360             else:
    361                 return self.http_error(url, fp, errcode, errmsg, headers, data)

C:\Anaconda\lib\urllib.pyc in http_error(self, url, fp, errcode, errmsg, headers, data)
    370             method = getattr(self, name)
    371             if data is None:
--> 372                 result = method(url, fp, errcode, errmsg, headers)
    373             else:
    374                 result = method(url, fp, errcode, errmsg, headers, data)

C:\Anaconda\lib\urllib.pyc in http_error_407(self, url, fp, errcode, errmsg, headers, data)
    709         if not match:
    710             URLopener.http_error_default(self, url, fp,
--> 711                                          errcode, errmsg, headers)
    712         scheme, realm = match.groups()
    713         if scheme.lower() != 'basic':

C:\Anaconda\lib\urllib.pyc in http_error_default(self, url, fp, errcode, errmsg, headers)
    379         """Default error handler: close the connection and raise IOError."""
    380         fp.close()
--> 381         raise IOError, ('http error', errcode, errmsg, headers)
    382 
    383     if _have_ssl:

IOError: ('http error', 407, 'authenticationrequired', <httplib.HTTPMessage instance at 0x057A5940>)

In [ ]: