##// END OF EJS Templates
use system_raw in terminal, even on Windows...
use system_raw in terminal, even on Windows `system_raw` uses `os.system` instead of `utils.process.system`, and makes more sense in a Terminal session. There was discussion that it should be otherwise on Windows, but I can't find any actual evidence for why this would be the case, and there are very clear disadvantages to not using `os.system` (see #978 and #181). closes gh-978

File last commit:

r4872:34c10438
r5276:a7b48096
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)