Issue
Is there a way to cause a programmatically generated url to open in a new browser tab or window from an IPython notebook cell?
Upon execution of the notebook cell the result should be the opening of a new tab or window pointing to the generated link.
NOTE: When I just return an IPython.core.display.HTML instance with a hyperlink the link is broken. If the url is copied and pasted into a browser window it is valid.
Solution
When you work with your standard browser, you can use the webbrowser
module:
import webbrowser
# generate an URL
url = 'https://' + 'www.google.com'
webbrowser.open(url)
Answered By - Mike Müller
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.