##// END OF EJS Templates
Merge pull request #1780 from jonathan-taylor/rmagic_extension...
Merge pull request #1780 from jonathan-taylor/rmagic_extension Rmagic extension to use R (the statistical package) seamlessly from IPython. The rmagic extension allows R inline code as well as cell level magics. An example notebook is provided in docs/examples/notebooks/rmagic_extension.ipynb to demonstrate its usage. Main points: 1) Allows capture of plots to R via inline png plots (like --pylab inline) 2) Allows capture of R's stdout() connection to the notebook 3) Allows simple push/pull for array data to/from R (via rpy2) with copy only on push to R -- this seems necessary.

File last commit:

r4872:34c10438
r7296:b1088356 merge
Show More
display.py
35 lines | 833 B | text/x-python | PythonLexer
"""Various display related classes.
Authors : MinRK
"""
class YouTubeVideo(object):
"""Class for embedding a YouTube Video in an IPython session, based on its video id.
e.g. to embed the video on this page:
http://www.youtube.com/watch?v=foo
you would do:
vid = YouTubeVideo("foo")
display(vid)
"""
def __init__(self, id, width=400, height=300):
self.id = id
self.width = width
self.height = height
def _repr_html_(self):
"""return YouTube embed iframe for this video id"""
return """
<iframe
width="%i"
height="%i"
src="http://www.youtube.com/embed/%s"
frameborder="0"
allowfullscreen
></iframe>
"""%(self.width, self.height, self.id)