Skip to content

Instantly share code, notes, and snippets.

@ddrscott
Created November 28, 2017 21:37
Show Gist options
  • Select an option

  • Save ddrscott/a693eb54fe8cdea5af85ec9e3f90e7af to your computer and use it in GitHub Desktop.

Select an option

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
#!/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