Created
November 28, 2017 21:37
-
-
Save ddrscott/a693eb54fe8cdea5af85ec9e3f90e7af to your computer and use it in GitHub Desktop.
Script to open website in dialog always on top of other windows using wxPython
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python2 | |
| """ | |
| Requirements: | |
| brew install wxMac | |
| brew install pip | |
| pip install wxPython | |
| Usage: | |
| pop.py https://www.gdax.com/trade/BTC-USD | |
| """ | |
| import sys | |
| import wx | |
| import wx.html2 | |
| def run(url): | |
| app = wx.App(False) | |
| frm = wx.Frame(None, title=url, style=wx.DEFAULT_FRAME_STYLE | wx.STAY_ON_TOP, size=(300, 480)) | |
| wv = wx.html2.WebView.New(frm) | |
| wv.LoadURL(url) | |
| sizer = wx.BoxSizer(wx.VERTICAL) | |
| sizer.Add(wv, 1, wx.EXPAND) | |
| frm.SetSizer(sizer) | |
| frm.SetMenuBar(wx.MenuBar()) | |
| frm.Center() | |
| frm.Show() | |
| app.MainLoop() | |
| if __name__ == '__main__': | |
| run(sys.argv[1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment