Ask Your Question

Frames in interacts

asked 2010-08-25 07:35:38 -0500

mhampton gravatar image

Is there a way to split the output of an interact into frames (html frames)? In particular I would like to be able to get the contents of a webpage (with urllib2 for example) and display it in a frame alongside other sorts of output.

edit retag flag offensive close merge delete


You can also try CSS frames.

ccanonc gravatar imageccanonc ( 2010-08-25 09:05:36 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2010-08-25 20:03:03 -0500

Mike Hansen gravatar image

It's easier to have the user's browser do the work if possible. I'm not sure what your specific use case is, but here is an interact which will load a page in a frame:

def iframe(url):
    html('<iframe src="%s" style="width: 100%%; height: 400px;"></iframe>'%(url))

def _(url=''):
edit flag offensive delete link more


Very Nice!

William Stein gravatar imageWilliam Stein ( 2010-08-25 20:12:18 -0500 )edit

Thanks, that helps. What I'd really like to do is have some web content in one frame, and Sage stuff in the other (for example, a 2d or 3d plot). Using <frameset> and your example I can get two webpages side by side, but not the Sage output (unless its html friendly).

mhampton gravatar imagemhampton ( 2010-08-26 04:29:37 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2010-08-25 07:35:38 -0500

Seen: 138 times

Last updated: Aug 25 '10